Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/notifications/test/notification.py

Issue 29329851: Issue 3216 - Prevent StopIteration exception (Closed)
Patch Set: Created Nov. 9, 2015, 9:16 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sitescripts/notifications/web/notification.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/notifications/test/notification.py
===================================================================
--- a/sitescripts/notifications/test/notification.py
+++ b/sitescripts/notifications/test/notification.py
@@ -361,5 +361,14 @@
self.assertEqual(result["notifications"][0]["id"], "b")
self.assertEqual(result["notifications"][1]["id"], "c")
+ def test_inactive_notification_variant_not_returned(self):
+ self.load_notifications_mock.return_value = [
+ {"id": "a", "inactive": True}
+ ]
+ result = json.loads(notification.notification({
+ "QUERY_STRING": "lastVersion=197001010000-a/1"
+ }, lambda *args: None))
+ self.assertEqual(len(result["notifications"]), 0)
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « no previous file | sitescripts/notifications/web/notification.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld