Minor fixes

This commit is contained in:
Vladimir Osintsev 2016-09-25 15:43:56 +03:00
parent 1ab6fe2a04
commit 3b61a71a71

View file

@ -298,19 +298,21 @@ class NotificationTestPages(TestCase):
def test_unread_list_api_mark_as_read(self):
self.login('to', 'pwd')
num_requested = 3
response = self.client.get(reverse('notifications:live_unread_notification_list'), data={
"max": num_requested,
"mark_as_read": 1,
})
response = self.client.get(
reverse('notifications:live_unread_notification_list'),
data={"max": num_requested, "mark_as_read": 1}
)
data = json.loads(response.content.decode('utf-8'))
self.assertEqual(data['unread_count'], self.message_count - num_requested)
self.assertEqual(data['unread_count'],
self.message_count - num_requested)
self.assertEqual(len(data['unread_list']), num_requested)
response = self.client.get(reverse('notifications:live_unread_notification_list'), data={
"max": num_requested,
"mark_as_read": 1,
})
response = self.client.get(
reverse('notifications:live_unread_notification_list'),
data={"max": num_requested, "mark_as_read": 1}
)
data = json.loads(response.content.decode('utf-8'))
self.assertEqual(data['unread_count'], 4)
self.assertEqual(data['unread_count'],
self.message_count - 2*num_requested)
self.assertEqual(len(data['unread_list']), num_requested)
def test_live_update_tags(self):