diff options
Diffstat (limited to 'archaeological_context_records/tests.py')
-rw-r--r-- | archaeological_context_records/tests.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index aa1e2f7c7..dd3d76d7c 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -65,7 +65,7 @@ class RecordRelationsTest(TestCase, ContextRecordInit): model = models.ContextRecord def setUp(self): - # two different context record + # two different context records self.create_context_record({"label":u"CR 1"}) self.create_context_record({"label":u"CR 2"}) @@ -74,7 +74,7 @@ class RecordRelationsTest(TestCase, ContextRecordInit): txt_idx='sym') rel_type_1 = models.RelationType.objects.create(symmetrical=False, txt_idx='rel_1') - # cannot have symmetrical and an inverse_relation + # cannot be symmetrical and have an inverse_relation with self.assertRaises(ValidationError): rel_test = models.RelationType.objects.create(symmetrical=True, inverse_relation=rel_type_1, txt_idx='rel_3') @@ -87,19 +87,20 @@ class RecordRelationsTest(TestCase, ContextRecordInit): cr_1 = self.context_records[0] cr_2 = self.context_records[1] - # inserting a new symetric relation automatically create the inverse - # relation + # inserting a new symmetrical relation automatically creates the same + # relation for the second context record rel = models.RecordRelations.objects.create(left_record=cr_1, right_record=cr_2, relation_type=sym_rel_type) self.assertEqual(models.RecordRelations.objects.filter(left_record=cr_2, right_record=cr_1, relation_type=sym_rel_type).count(), 1) - # remove one symetric relation remove the other + # removing one symmetrical relation removes the other rel.delete() self.assertEqual(models.RecordRelations.objects.filter(left_record=cr_2, right_record=cr_1, relation_type=sym_rel_type).count(), 0) - # for non symetric relation adding one relation add the inverse + # for non-symmetrical relation, adding one relation automatically + # adds the inverse rel = models.RecordRelations.objects.create(left_record=cr_1, right_record=cr_2, relation_type=rel_type_1) self.assertEqual(models.RecordRelations.objects.filter(left_record=cr_2, |