From 8004ba367a09dbe8d7c7823f314ce897512ee700 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Mon, 15 Oct 2018 17:46:04 +0000 Subject: [PATCH] Better constrain a liaison test object to match the preconditions for the test. Commit ready for merge. - Legacy-Id: 15580 --- ietf/liaisons/tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ietf/liaisons/tests.py b/ietf/liaisons/tests.py index 312348f72..cbecd3fe2 100644 --- a/ietf/liaisons/tests.py +++ b/ietf/liaisons/tests.py @@ -1014,7 +1014,7 @@ class LiaisonManagementTests(TestCase): # Statement 1 LiaisonStatementEventFactory(type_id='posted', statement__body="Has recently in its body",statement__from_groups=[GroupFactory(type_id='sdo',acronym='ulm'),]) # Statement 2 - s2 = LiaisonStatementEventFactory(type_id='posted', statement__body="That word does not occur here") + s2 = LiaisonStatementEventFactory(type_id='posted', statement__body="That word does not occur here", statement__title="Nor does it occur here") s2.time=datetime.datetime(2010,1,1) s2.save() @@ -1033,6 +1033,10 @@ class LiaisonManagementTests(TestCase): self.assertEqual(len(q('tr')),0) # no results # test body text + # The view being tested looks for the word "recently" in several fields + # The test data right now constrains the second statement's body and title to not contain that word + # if the factories start generating in the other places it looks (see SearchLiaisonForm), this test + # will need to be smarter about inspecting or further constraining the test objects. url = urlreverse('ietf.liaisons.views.liaison_list') + "?text=recently&source=&destination=&start_date=&end_date=" r = self.client.get(url) q = PyQuery(r.content)