summaryrefslogtreecommitdiff
path: root/archaeological_finds/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r--archaeological_finds/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 933b5f292..b4a798807 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -412,6 +412,20 @@ class FindTest(FindInit, TestCase):
self.assertEqual(response.status_code, 200)
self.assertIn('class="sheet"', response.content)
+ def test_delete(self):
+ self.create_finds(force=True)
+ first_bf = self.base_finds[0]
+ self.finds[1].base_finds.add(first_bf)
+
+ self.finds[0].delete()
+ # on delete the selected base find is not deleted if another find
+ # is related to it
+ self.assertEqual(models.BaseFind.objects.filter(
+ pk=self.base_finds[0].pk).count(), 1)
+ self.finds[1].delete()
+ self.assertEqual(models.BaseFind.objects.filter(
+ pk=self.base_finds[0].pk).count(), 0)
+
class FindSearchTest(FindInit, TestCase):
fixtures = FIND_FIXTURES