X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/form?a=blobdiff_plain;f=tests%2Ftodos.py;h=0998c690494e60ae864e929e205c16549b4ebe9a;hb=c49e55023d5e9d91bcf1433fe893f574184efcb5;hp=8b8099f509a70029b45a24cef229cca162985e73;hpb=e87f540aa7b550881462cb88380a773b328c0a3d;p=plomtask diff --git a/tests/todos.py b/tests/todos.py index 8b8099f..0998c69 100644 --- a/tests/todos.py +++ b/tests/todos.py @@ -274,7 +274,7 @@ class TestsWithServer(TestCaseWithServer): '/day?date=2024-01-01&make_type=full', 302) # test posting to bad URLs self.check_post({}, '/todo=', 404) - self.check_post({}, '/todo?id=', 400) + self.check_post({}, '/todo?id=', 404) self.check_post({}, '/todo?id=FOO', 400) self.check_post({}, '/todo?id=0', 404) # test posting naked entity @@ -400,11 +400,12 @@ class TestsWithServer(TestCaseWithServer): form_data = {'day_comment': '', 'new_todo': [1], 'make_type': 'full'} self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302) todo = Todo.by_date(self.db_conn, '2024-01-01')[0] - form_data = {'day_comment': '', 'todo_id': [1], 'make_type': 'full'} + form_data = {'day_comment': '', 'todo_id': [1], 'make_type': 'full', + 'comment': [''], 'done': [], 'effort': ['']} self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302) self.assertEqual(todo.is_done, False) form_data = {'day_comment': '', 'todo_id': [1], 'done': [1], - 'make_type': 'full'} + 'make_type': 'full', 'comment': [''], 'effort': ['']} self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302) self.assertEqual(todo.is_done, True) @@ -413,8 +414,8 @@ class TestsWithServer(TestCaseWithServer): self.post_process() form_data = {'day_comment': '', 'new_todo': 1, 'make_type': 'full'} self.check_post(form_data, '/day?date=2024-01-01&make_type=full', 302) - self.check_get('/todo', 400) - self.check_get('/todo?id=', 400) + self.check_get('/todo', 404) + self.check_get('/todo?id=', 404) self.check_get('/todo?id=foo', 400) self.check_get('/todo?id=0', 404) self.check_get('/todo?id=1', 200)