Commit ed1251d3 authored by Patrick James Ong's avatar Patrick James Ong

Finished storyline part 4

parent c6c87b6b
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django.views.generic.list import ListView # from django.views.generic.list import ListView
from django.views.generic.detail import DetailView # rom django.views.generic.detail import DetailView
# Create your views here. # Create your views here.
class HomeListView(TemplateView): class HomeListView(TemplateView):
template_name = 'home.html' template_name = 'home.html'
class CloudDetailView(DetailView): class CloudDetailView(TemplateView):
template_name = 'detail_cloud.html' template_name = 'detail_cloud.html'
class JesterDetailView(DetailView): class JesterDetailView(TemplateView):
template_name = 'detail_jester.html' template_name = 'detail_jester.html'
class SunfloweyDetailView(DetailView): class SunfloweyDetailView(TemplateView):
template_name = 'detail_sunflowey.html' template_name = 'detail_sunflowey.html'
from selenium import webdriver from selenium import webdriver
import unittest import unittest
import time
class NewVisitorTest(unittest.TestCase): class NewVisitorTest(unittest.TestCase):
...@@ -35,20 +36,22 @@ class NewVisitorTest(unittest.TestCase): ...@@ -35,20 +36,22 @@ class NewVisitorTest(unittest.TestCase):
# When she selects one of the heroes, she is sent to another page # When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image). # containing more information about the hero (additional stats, lore, image).
#self.browser.get('http://localhost:8000/hero/cloud') self.browser.get('http://localhost:8000/hero/cloud')
#self.browser.get('http://localhost:8000/hero/sunflowey') #self.browser.get('http://localhost:8000/hero/sunflowey')
#self.browser.get('http://localhost:8000/hero/jester') #self.browser.get('http://localhost:8000/hero/jester')
# She spots the page title and header mentions the name of the hero she selected. # She spots the page title and header mentions the name of the hero she selected.
#self.assertIn('Cloud', self.browser.title) self.assertIn('Cloud', self.browser.title)
#self.assertIn('Sunflowey', self.browser.title) #self.assertIn('Sunflowey', self.browser.title)
#self.assertIn('Jester', self.browser.title) #self.assertIn('Jester', self.browser.title)
time.sleep(1)
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List". # While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# She clicks this and she is redirected back to the wiki's homepage. # She clicks this and she is redirected back to the wiki's homepage.
#self.browser.get('http://localhost:8000') self.browser.get('http://localhost:8000')
time.sleep(1)
#self.fail('Finish the test!') self.fail('Finish the test!')
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(warnings='ignore') unittest.main(warnings='ignore')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment