Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit c607ff2b authored by Agas Yanpratama's avatar Agas Yanpratama :speech_balloon:
Browse files

Test Automated Comment Bug Fix Done

parent f41711db
No related branches found
No related tags found
1 merge request!10Ch7 Done
Pipeline #22871 passed
...@@ -115,19 +115,49 @@ class NewItemTest(TestCase): ...@@ -115,19 +115,49 @@ class NewItemTest(TestCase):
def test_one_todo(self): def test_one_todo(self):
other_list = List.objects.create() other_list = List.objects.create()
correct_list = List.objects.create() correct_list = List.objects.create()
self.client.post('/', data={'item_text': 'List item 1'}) self.client.post(
response = self.client.get('/') f'/lists/{correct_list.id}/add_item',
data={'item_text': 'item 1'}
)
response = self.client.get(
f'/lists/{correct_list.id}/'
)
self.assertIn('task amount: 1', response.content.decode('utf-8')) self.assertIn('task amount: 1', response.content.decode('utf-8'))
self.assertIn('sibuk tapi masih bisa dikendalikan', response.content.decode('utf-8')) self.assertIn('sibuk tapi masih bisa dikendalikan', response.content.decode('utf-8'))
def test_five_todo(self): def test_five_todo(self):
other_list = List.objects.create() other_list = List.objects.create()
correct_list = List.objects.create() correct_list = List.objects.create()
self.client.post('/', data={'item_text': 'List item 1'}) self.client.post(
self.client.post('/', data={'item_text': 'List item 2'}) f'/lists/{correct_list.id}/add_item',
self.client.post('/', data={'item_text': 'List item 3'}) data={'item_text': 'item 1'}
self.client.post('/', data={'item_text': 'List item 4'}) )
self.client.post('/', data={'item_text': 'List item 5'})
response = self.client.get('/') self.client.post(
f'/lists/{correct_list.id}/add_item',
data={'item_text': 'item 2'}
)
self.client.post(
f'/lists/{correct_list.id}/add_item',
data={'item_text': 'item 3'}
)
self.client.post(
f'/lists/{correct_list.id}/add_item',
data={'item_text': 'item 4'}
)
self.client.post(
f'/lists/{correct_list.id}/add_item',
data={'item_text': 'item 5'}
)
response = self.client.get(
f'/lists/{correct_list.id}/'
)
self.assertIn('task amount: 5', response.content.decode('utf-8')) self.assertIn('task amount: 5', response.content.decode('utf-8'))
self.assertIn('oh tidak, harus dikerjakan secepatnya', response.content.decode('utf-8')) self.assertIn('oh tidak, harus dikerjakan secepatnya', response.content.decode('utf-8'))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment