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

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

Issue 29327106: Issue 3048 - Mark inactive notifications instead of removing them (Closed)
Patch Set: Created Sept. 10, 2015, 11: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 | « sitescripts/notifications/test/notification.py ('k') | 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/parser.py
===================================================================
--- a/sitescripts/notifications/test/parser.py
+++ b/sitescripts/notifications/test/parser.py
@@ -69,7 +69,8 @@
inactive = True
""")
notifications = parser.load_notifications()
- self.assertEqual(len(notifications), 0)
+ self.assertEqual(len(notifications), 1)
+ self.assertTrue(notifications[0]["inactive"])
def test_in_range(self):
current_time = datetime.datetime.now()
@@ -83,6 +84,7 @@
notifications = parser.load_notifications()
self.assertEqual(len(notifications), 1)
self.assertEqual(notifications[0]["id"], "1")
+ self.assertNotIn("inactive", notifications[0])
def test_after_range(self):
current_time = datetime.datetime.now()
@@ -93,7 +95,8 @@
end = %s
""" % (_format_time(start_time), _format_time(end_time)))
notifications = parser.load_notifications()
- self.assertEqual(len(notifications), 0)
+ self.assertEqual(len(notifications), 1)
+ self.assertTrue(notifications[0]["inactive"])
def test_before_range(self):
current_time = datetime.datetime.now()
@@ -104,7 +107,8 @@
end = %s
""" % (_format_time(start_time), _format_time(end_time)))
notifications = parser.load_notifications()
- self.assertEqual(len(notifications), 0)
+ self.assertEqual(len(notifications), 1)
+ self.assertTrue(notifications[0]["inactive"])
def test_start_and_end_not_present(self):
current_time = datetime.datetime.now()
« no previous file with comments | « sitescripts/notifications/test/notification.py ('k') | sitescripts/notifications/web/notification.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld