def test_mark_as_read(self):
     self.client.login(username='******', password='******')
     self.client.get('/create')
     inbox = Inbox.objects.filter(user=self.user)
     self.assertEqual(len(inbox), 1)
     mark_read(self.user, inbox.get().message)
     self.assertEqual(Inbox.objects.filter(user=self.user).count(), 0)
Beispiel #2
0
 def test_mark_as_read_idempotent(self):
     self.client.login(username='******', password='******')
     self.client.get('/create')
     msg_archive = MessageArchive.objects.filter(user=self.user).get()
     mark_read(self.user, msg_archive.message)
     self.assertRaises(MessageDoesNotExist, mark_read, self.user,
                       msg_archive.message)
Beispiel #3
0
 def test_mark_as_read(self):
     self.client.login(username='******', password='******')
     self.client.get('/create')
     inbox = Inbox.objects.filter(user=self.user)
     self.assertEqual(len(inbox), 1)
     mark_read(self.user, inbox.get().message)
     self.assertEqual(Inbox.objects.filter(user=self.user).count(), 0)
 def test_mark_as_read_idempotent(self):
     self.client.login(username='******', password='******')
     self.client.get('/create')
     msg_archive = MessageArchive.objects.filter(user=self.user).get()
     mark_read(self.user, msg_archive.message)
     self.assertRaises(MessageDoesNotExist, mark_read, self.user, msg_archive.message)
 def test_mark_as_read_idempotent(self):
     self.client.login(username="******", password="******")
     self.client.get("/create")
     msg = MessageArchive.objects.filter(user=self.user).get()
     mark_read(self.user, msg)
     self.assertRaises(MessageDoesNotExist, mark_read, self.user, msg)
 def test_mark_as_read_idempotent(self):
     self.client.login(username='******', password='******')
     self.client.get('/create')
     msg = MessageArchive.objects.filter(user=self.user).get()
     self.assertTrue(mark_read(self.user, msg))
     self.assertFalse(mark_read(self.user, msg))