diff options
Diffstat (limited to 'Post/test.py')
-rwxr-xr-x | Post/test.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Post/test.py b/Post/test.py index 35f9fa6..a5874b4 100755 --- a/Post/test.py +++ b/Post/test.py @@ -4,22 +4,24 @@ import json from django.test import Client from Post.models import BuildFailure, Build - +#Delete the data between tests def delete_data_after (func): def wrap(*args, **kwargs): - func(*args, **kwargs) self = args[0] - bfo = BuildFailure.objects.all() bo = Build.objects.all() + bfo = BuildFailure.objects.all() + + bo.delete() + + # run the test + func(*args, **kwargs) + # The submission should have added one row in each table self.assertEqual(bfo.count(), 1) self.assertEqual(bo.count(), 1) - bfo.delete() - bo.delete() - return wrap |