quick save everything to git while it all works somehow; fixing the problems...

quick save everything to git while it all works somehow; fixing the problems with templates, creating home.html which wasn't given, so far it works for the basic test commit
parent 111bcca1
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>The Will of the Wisps Wiki</title>
</head>
<body>
<h1>WELCOME TO THE F HOME PAGE</h1>
<dl>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>The Will of the Wisps Wiki</title>
</head>
<body>
<h1>WELCOME TO THE F HOME PAGE</h1>
<dl>
</dl>
</body>
</html>
\ No newline at end of file
from selenium import webdriver from selenium import webdriver
import unittest import unittest
from .views import HomeView
class NewVisitorTest(unittest.TestCase): class NewVisitorTest(unittest.TestCase):
def setUp(self): def setUp(self):
self.browser = webdriver.Firefox() self.browser = webdriver.Firefox()
self.browser.implicitly_wait(30)
def tearDown(self): def tearDown(self):
self.browser.quit() self.browser.quit()
...@@ -11,11 +13,11 @@ class NewVisitorTest(unittest.TestCase): ...@@ -11,11 +13,11 @@ class NewVisitorTest(unittest.TestCase):
def test_can_display_a_heroes_list_and_more_information_per_hero(self): def test_can_display_a_heroes_list_and_more_information_per_hero(self):
# Widget has heard about a new wiki app for the game called The Will of the Wisps. # Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage # She goes to check out its homepage
self.browser.get('http://127.0.0.1:8000') self.browser.get('http://localhost:8000')
# She notices the page title and header mention # She notices the page title and header mention
# 'The Will of the Wisps Wiki' # 'The Will of the Wisps Wiki'
#self.assertIn('The Will of the Wisps Wiki', self.browser.title) self.assertIn('The Will of the Wisps Wiki', self.browser.title)
# She sees a list containing three heroes with their corresponding # She sees a list containing three heroes with their corresponding
# names, health points, and damage # names, health points, and damage
...@@ -27,5 +29,8 @@ class NewVisitorTest(unittest.TestCase): ...@@ -27,5 +29,8 @@ class NewVisitorTest(unittest.TestCase):
# 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.assertEqual(resolve('/').func, home)
self.fail('Finish the test!')
#self.fail('Finish the test!') if __name__ == '__main__':
\ No newline at end of file unittest.main(warnings='ignore')
\ No newline at end of file
from django.conf.urls import url
from .views import HomeView, CloudView, JesterView, SunfloweyView
urlpatterns = [
url(r'^$', HomeView.as_view(), name = 'home'),
url(r'^heroes/$', HomeView.as_view(), name = 'home'),
url(r'^hero/cloud$', CloudView.as_view(), name = 'cloud'),
url(r'^hero/jester$', JesterView.as_view(), name = 'jester'),
url(r'^hero/sunflowey$', SunfloweyView.as_view(), name = 'sunflowey'),
]
from django.shortcuts import render # from django.shortcuts import render
# Create your views here. # def home_page(request):
# return render(request, 'heroes/home_page.html')
# def cloud(request):
# return render(request, 'heroes/detail_cloud.html')
# def jester(request):
# return render(request, 'heroes/detail_jester.html')
# def sunflowey(request):
# return render(request, 'heroes/detail_sunflowey.html')
from django.views.generic.base import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
class CloudView(TemplateView):
template_name = 'detail_cloud.html'
class JesterView(TemplateView):
template_name = 'detail_jester.html'
class SunfloweyView(TemplateView):
template_name = 'detail_sunflowey.html'
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>The Will of the Wisps Wiki</title>
</head>
<body>
<h1>WELCOME TO THE F HOME PAGE</h1>
<dl>
</dl>
</body>
</html>
\ No newline at end of file
...@@ -56,7 +56,7 @@ ROOT_URLCONF = 'willowisp.urls' ...@@ -56,7 +56,7 @@ ROOT_URLCONF = 'willowisp.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'heroes', 'templates')],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
......
...@@ -13,10 +13,11 @@ Including another URLconf ...@@ -13,10 +13,11 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include 1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
""" """
from django.conf.urls import url from django.conf.urls import url, include
from django.contrib import admin from django.contrib import admin
urlpatterns = [ urlpatterns = [
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'', include('heroes.urls')),
] ]
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