Fakultas Ilmu Komputer UI

Commit b3105a65 authored by Agas Yanpratama's avatar Agas Yanpratama 💬
Browse files

Fix typo on test views and fix models calling on test models

parent b3c56e6e
Pipeline #28428 failed with stages
in 5 minutes and 31 seconds
......@@ -4,7 +4,7 @@ from django.http import HttpRequest
from django.template.loader import render_to_string
from lists.views import home_page
from lists.views import home_page, delete_item
from lists.models import Item, List
class ListAndItemModelsTest(TestCase):
......@@ -51,7 +51,7 @@ class ListAndItemModelsTest(TestCase):
saved_list = List.objects.first()
saved_obj = saved_items[0]
deleteItem(self, saved_list.id, saved_items.id)
saved_obj.delete()
saved_items_after_del = Item.objects.all()
self.assertEqual(saved_items_after_del.count(), 0)
......
......@@ -142,7 +142,7 @@ class DeleteItemTest(TestCase):
newTodoItem = Item.objects.create(text='item 1', list=new_list)
self.client.post(
f'/lists/{correct_list.id}/delete_item',
f'/lists/{new_list.id}/delete_item',
data={'todo_id': newTodoItem.id}
)
......@@ -155,8 +155,8 @@ class DeleteItemTest(TestCase):
newTodoItem = Item.objects.create(text='item 1', list=new_list)
response = self.client.post(
f'/lists/{correct_list.id}/delete_item',
f'/lists/{new_list.id}/delete_item',
data={'todo_id': newTodoItem.id}
)
self.assertRedirects(response, f'/lists/{correct_list.id}/')
\ No newline at end of file
self.assertRedirects(response, f'/lists/{new_list.id}/')
\ No newline at end of file
Markdown is supported
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