Commit 8f5273eb authored by cianlaguesma's avatar cianlaguesma

added views and urls and a base html file for heroes.html

parent f391e107
File added
<html>
<head>
<h1>The Will of the Wisps Wiki</h1>
</head>
</html>
from django.conf.urls import url
from .views import home_page, hero_cloud, hero_jester, hero_sunflowey
urlpatterns = [
url(r'^heroes$', home_page, name='home_page'),
url(r'^hero/cloud$', hero_cloud, name='hero_cloud'),
url(r'^hero/jester$', hero_jester, name='hero_jester'),
url(r'^hero/sunflowey$', hero_sunflowey, name='hero_sunflowey')
]
from django.shortcuts import render
# Create your views here.
def home_page(request):
return render(request, 'heroes.html')
def hero_cloud(request):
return render(request, 'detail_cloud.html')
def hero_jester(request):
return render(request, 'detail_jester.html')
def hero_sunflowey(request):
return render(request, 'detail_sunflowey.html')
from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
......@@ -11,7 +12,7 @@ class NewVisitorTest(unittest.TestCase):
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.
# She goes to check out its homepage
browser.get('http://localhost:8000')
browser.get('http://localhost:8000/heroes')
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
......
......@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'heroes',
]
MIDDLEWARE = [
......
......@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
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