Commits

Konstantin Mochalov committed 942f702

Tests for deletion

Comments (0)

Files changed (1)

             'date_start': '2013-08-13T17:39:37',
             }), content_type='text/json')
         self.assertEquals(r.status_code, 404)
+
+    def test_delete_task(self):
+        r = Client().delete('/tasks/12')
+        self.assertEquals(r.status_code, 200)
+
+        ids = set(task.id for task in Task.objects.all())
+        expected_ids = set(range(1, self.TASKS_IN_INITIAL_DATA + 1)) - set([12])
+        self.assertEquals(ids, expected_ids)
+
+    def test_detele_task_404(self):
+        r = Client().delete('/tasks/2873')
+        self.assertEquals(r.status_code, 404)