Skip to content

Commit

Permalink
test8
Browse files Browse the repository at this point in the history
  • Loading branch information
budhrajaankita committed Apr 22, 2024
1 parent 40a8112 commit 64ab167
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tasks/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,19 @@ def test_valid_data(self):
# form.save()
# self.assertEqual(Task.objects.count(), 1)


def test_taskcount(self):
form = TaskForm({
'title': "Task count",
'description': "Test task count increase",
'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)

0 comments on commit 64ab167

Please sign in to comment.