def test_admin_read(self): request = testing.DummyRequest(user=self.user0, matchdict={"id": self.pm1.id}) info = pm_read(request) self.assertFalse(self.pm1.is_read) self.assertDictEqual(info, {"pm": self.pm1})
def test_owner_read(self): request = testing.DummyRequest(user=self.user1, matchdict={"id": self.pm1.id}) info = pm_read(request) self.assertTrue(self.pm1.is_read) self.assertDictEqual(info, {"pm": self.pm1})