summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-09 23:27:55 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-09 23:27:55 +0100
commit1a39ea814072d06e821c695063e2b95db206b460 (patch)
tree1747dde4703a0b8a63372a1c89631c989a980e2b /archaeological_operations/tests.py
parentd89dd18aa21a3054ed789d55201d68bf77b527a0 (diff)
parent097c8162391f62489d94ffc92b6c81549d0b547c (diff)
downloadIshtar-1a39ea814072d06e821c695063e2b95db206b460.tar.bz2
Ishtar-1a39ea814072d06e821c695063e2b95db206b460.zip
Merge branch 'develop' into develop-bootstrap
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index b75c02cae..ec7ae44c5 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -857,6 +857,23 @@ class OperationTest(TestCase, OperationInitTest):
parcel.save()
self.assertEqual(parcel.external_id, 'blabla')
+ def test_associated(self):
+ scientist = Person.objects.create(name="C-3PO")
+ self.item.scientist = scientist
+ self.item.save()
+ scientist = Person.objects.get(pk=scientist.pk)
+ self.assertIn(PersonType.objects.get(txt_idx='head_scientist'),
+ scientist.person_types.all())
+
+ # do not change if in the list
+ sra = Person.objects.create(name="R2D2")
+ sra.person_types.add(PersonType.objects.get(txt_idx='sra_agent'))
+ self.item.scientist = sra
+ self.item.save()
+ self.assertNotIn(PersonType.objects.get(txt_idx='head_scientist'),
+ sra.person_types.all())
+
+
def create_relations(self):
rel1 = models.RelationType.objects.create(
symmetrical=True, label='Include', txt_idx='include')