From 40026726b089465b45912edf32ff3fe9364a65a6 Mon Sep 17 00:00:00 2001 From: Cefin Date: Fri, 11 Mar 2022 17:24:27 +0100 Subject: Context Record, Bulk update : draft two of tests #5293 --- archaeological_context_records/tests.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'archaeological_context_records') diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index 4e98ec941..cabd6dcce 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -587,13 +587,18 @@ class ContextRecordQATest(ContextRecordInit, TestCase): print(models.Unit.objects.all()) print(models.Operation.objects.all()) c.login(username=self.username, password=self.password) - print(pks) response = c.get(reverse("contextrecord-qa-bulk-update", args=[pks])) print(response) self.assertEqual(response.status_code, 200) cr_1 = self.context_records[0] cr_2 = self.context_records[1] + + parcel = models.Parcel.objects.all().first() + operation = models.Operation.objects.all().first() + parcel.operation = operation + cr_1.operation = operation + cr_2.operation = operation unit = models.Unit.objects.all().first() sym_rel_type = models.RelationType.objects.create( symmetrical=True, txt_idx="sym" @@ -605,6 +610,7 @@ class ContextRecordQATest(ContextRecordInit, TestCase): data = { "qa_unit": unit.pk, "qa_relation_type": sym_rel_type, + "qa_parcel": parcel.pk } response = c.post(reverse( @@ -616,7 +622,8 @@ class ContextRecordQATest(ContextRecordInit, TestCase): crs = models.ContextRecord.objects.all() for cr in crs: - self.assertEqual(cr.unit, su) + print(cr.unit) + self.assertEqual(cr.unit, unit) class ContextRecordSearchTest(ContextRecordInit, TestCase, SearchText): -- cgit v1.2.3