Fakultas Ilmu Komputer UI

Commit 69800cdb authored by Kevin Albert Simanjuntak's avatar Kevin Albert Simanjuntak
Browse files

[red] implement comment testing in test.py

parent effb20c4
Pipeline #20852 failed with stage
in 1 minute and 5 seconds
......@@ -49,6 +49,17 @@ class HomePageTest(TestCase):
self.assertIn('itemey 1', response.content.decode())
self.assertIn('itemey 2', response.content.decode())
def test_displays_comment(self):
response = self.client.get('/homepage/')
self.assertIn('<h2 id="comment">yey, waktunya berlibur</h2>', response.content.decode())
Item.objects.create(text='itemey 1')
Item.objects.create(text='itemey 2')
self.assertIn('<h2 id="comment">sibuk tapi santai</h2>', response.content.decode())
Item.objects.create(text='itemey 3')
Item.objects.create(text='itemey 4')
Item.objects.create(text='itemey 5')
self.assertIn('<h2 id="comment">oh tidak</h2>', response.content.decode())
class ItemModelTest(TestCase):
def test_saving_and_retrieving_items(self):
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