Merged in [15580] from rjsparks@nostrum.com:

Better constrain a liaison test object to match the preconditions for the test.
 - Legacy-Id: 15594
Note: SVN reference [15580] has been migrated to Git commit 8004ba367a
This commit is contained in:
Henrik Levkowetz 2018-10-17 13:50:34 +00:00
commit 977b3ca74a
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,7 @@
# -*- conf-mode -*-
/personal/rjs/6.86.1.dev0@15568 # Test coverage lower
/personal/rcross/6.81.3.dev0@15262 # Secretariat admin access to Document has drawbacks
/personal/sbirkholz/mtgreg3@14074 # reviewed with issues; feedback sent
/personal/sbirkholz/meeting_registration@13969 # manual branch merge

View file

@ -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)