Commit c123899d authored by Kyla Villegas's avatar Kyla Villegas

Created and passed first unit testing

parent 15adec11
from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from .views import home_page
# Create your tests here.
class HomePageTest(TestCase):
def test_root_url_resolves_to_home_page_view(self):
found = resolve('/')
self.assertEqual(found.func, home_page)
def test_home_page_returns_correct_html(self):
request = HttpRequest()
response = home_page(request)
html = response.content.decode('utf8')
self.assertTrue(html.startswith('<html>'))
self.assertIn('<title>The Will of the Wisps Wiki</title>'', html)
self.assertTrue(html.endswith('</html>'))
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