home · contact · privacy
Extend Condition tests.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 28 Apr 2024 22:53:54 +0000 (00:53 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 28 Apr 2024 22:53:54 +0000 (00:53 +0200)
tests/conditions.py

index 6538e87019bfa7bffa0d8fccb22f8981500943d1..db6c745da7a0fd6c4b7afbe9ac740f45fbf2572e 100644 (file)
@@ -62,6 +62,11 @@ class TestsWithServer(TestCaseWithServer):
         form_data = {'title': 'foo', 'description': 'foo'}
         self.check_post(form_data, '/condition', 302, '/condition?id=1')
         self.assertEqual(1, len(Condition.all(self.db_conn)))
+        form_data['delete'] = ''
+        self.check_post(form_data, '/condition?id=', 404)
+        self.check_post(form_data, '/condition?id=2', 404)
+        self.check_post(form_data, '/condition?id=1', 302, '/conditions')
+        self.assertEqual(0, len(Condition.all(self.db_conn)))
 
     def test_do_GET(self) -> None:
         """Test /condition and /conditions response codes."""