Skip to content

Commit 8004ba3

Browse files
committed
Better constrain a liaison test object to match the preconditions for the test. Commit ready for merge.
- Legacy-Id: 15580
1 parent 2935940 commit 8004ba3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ietf/liaisons/tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def test_search(self):
10141014
# Statement 1
10151015
LiaisonStatementEventFactory(type_id='posted', statement__body="Has recently in its body",statement__from_groups=[GroupFactory(type_id='sdo',acronym='ulm'),])
10161016
# Statement 2
1017-
s2 = LiaisonStatementEventFactory(type_id='posted', statement__body="That word does not occur here")
1017+
s2 = LiaisonStatementEventFactory(type_id='posted', statement__body="That word does not occur here", statement__title="Nor does it occur here")
10181018
s2.time=datetime.datetime(2010,1,1)
10191019
s2.save()
10201020

@@ -1033,6 +1033,10 @@ def test_search(self):
10331033
self.assertEqual(len(q('tr')),0) # no results
10341034

10351035
# test body text
1036+
# The view being tested looks for the word "recently" in several fields
1037+
# The test data right now constrains the second statement's body and title to not contain that word
1038+
# if the factories start generating in the other places it looks (see SearchLiaisonForm), this test
1039+
# will need to be smarter about inspecting or further constraining the test objects.
10361040
url = urlreverse('ietf.liaisons.views.liaison_list') + "?text=recently&source=&destination=&start_date=&end_date="
10371041
r = self.client.get(url)
10381042
q = PyQuery(r.content)

0 commit comments

Comments
 (0)