diff --git a/tasks/tests.py b/tasks/tests.py index 61aac0a..e9dfc0f 100644 --- a/tasks/tests.py +++ b/tasks/tests.py @@ -49,6 +49,7 @@ def test_valid_data(self): # form.save() # self.assertEqual(Task.objects.count(), 1) + def test_taskcount(self): form = TaskForm({ 'title': "Task count", @@ -56,5 +57,11 @@ def test_taskcount(self): 'completed': False }) form.save() - self.assertEqual(Task.objects.count(), 2) + self.assertEqual(Task.objects.count(), 1) + + + def test_form_blank_data(self): + form = TaskForm({}) + self.assertFalse(form.is_valid()) + self.assertEqual(len(form.errors), 3)