Fakultas Ilmu Komputer UI

Commit d6de394d authored by Putu Agastya's avatar Putu Agastya
Browse files

[CHORES] Reenable testing, disabled because faulty

parent 8d00f589
from django.test import TestCase, Client
from django.urls import resolve
#class TemplateLoaderTest(TestCase):
# def test_template_loader_url_exist(self):
# url = "/test-page.html"
# response = Client().get(url)
# self.assertEqual(response.status_code,200)
#
# def test_template_loader_using_template_loader_template(self):
# url = "/test-page.html"
# response = Client().get(url)
# expected_template_name = "test-page.html"
# self.assertTemplateUsed(response, expected_template_name)
#
# def test_template_loader_using_template_loader_func(self):
# url = "/test-page.html"
# found = resolve(url)
# expected_view_name = "pages"
# 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
class TemplateLoaderTest(TestCase):
def test_template_loader_url_exist(self):
url = "/test-page.html"
response = Client().get(url)
self.assertEqual(response.status_code, 200)
def test_template_loader_using_template_loader_template(self):
url = "/test-page.html"
response = Client().get(url)
expected_template_name = "test-page.html"
self.assertTemplateUsed(response, expected_template_name)
def test_template_loader_using_template_loader_func(self):
url = "/test-page.html"
found = resolve(url)
expected_view_name = "pages"
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)
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