+        view = create_initialized_view(sprint, '+index')
+        with StormStatementRecorder() as recorder:
+            view.render()
+        self.assertThat(recorder, HasQueryCount(LessThan(10)))

This will give incorrect results, because render doesn't do what a
proper page render does (including things like portlet rendering).
from lp.testing.matchers import BrowsesWithQueryLimit
self.assertThat(sprint, BrowsersWithQueryLimit(10, sprint.owner))

will test this more reliably.

-- 
https://code.launchpad.net/~thumper/launchpad/sprint-attendees/+merge/53941
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~thumper/launchpad/sprint-attendees into lp:launchpad.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to