Fakultas Ilmu Komputer UI

Commit 98e2fbad authored by Putu Agastya's avatar Putu Agastya
Browse files

[GREEN] Added test for invalid template.

parent 3907e625
......@@ -17,4 +17,11 @@ class TemplateLoaderTest(TestCase):
url = "/test-page.html"
found = resolve(url)
expected_view_name = "pages"
self.assertEqual(found.func.__name__, expected_view_name)
\ No newline at end of file
self.assertEqual(found.func.__name__, expected_view_name)
def test_template_loader_handle_non_existent_html(self):
url = "/test.html"
expected_template_name = "error-404.html"
response = Client().get(url)
self.assertEqual(response.status_code,200)
self.assertTemplateUsed(response, expected_template_name)
\ No newline at end of file
Supports Markdown
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