Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit c3386a99 authored by jordan's avatar jordan
Browse files

Move unit tests into a folder with single file

parent fcc6e2f8
No related branches found
No related tags found
1 merge request!9Latihan5
{
"folders": [
{
"path": "/Users/jonsnow/Documents/Tugas/Semester-9/pmpl/kape"
},
{
"path": "."
}
]
}
\ No newline at end of file
......@@ -14,21 +14,21 @@ class HomePageTest(TestCase):
self.assertEqual(found.func, home_page)
# "<input type='hidden' name='csrfmiddlewaretoken' value='%' />" %csrf_string
def test_home_page_returns_correct_html(self):
request = HttpRequest() #
response = home_page(request) #
#def test_home_page_returns_correct_html(self):
# request = HttpRequest() #
# response = home_page(request) #
# expected_html = render_to_string('home.html')
# self.assertEqual(response.content.decode(), expected_html)
self.assertTrue(response.content.startswith(b"<html>")) #
self.assertIn(b"<h1>Jordan M A</h1>", response.content)
self.assertIn(b"<h2>1506722765</h2>", response.content)
self.assertTrue(response.content.strip().endswith(b"</html>")) #
# self.assertTrue(response.content.startswith(b"<html>")) #
# self.assertIn(b"<h1>Jordan M A</h1>", response.content)
# self.assertIn(b"<h2>1506722765</h2>", response.content)
# self.assertTrue(response.content.strip().endswith(b"</html>")) #
def test_home_page_right_comments_when_zero(self):
request = HttpRequest()
response = home_page(request)
self.assertIn(b'<h1 id="comment">yey, waktunya berlibur</h1>', response.content)
#def test_home_page_right_comments_when_zero(self):
# request = HttpRequest()
# response = home_page(request)
# self.assertIn(b'<h1 id="comment">yey, waktunya berlibur</h1>', response.content)
# def test_home_page_right_comments_when_less_then_five(self):
# Item.objects.create(text="itemey 1")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment