class PongMessageSerializerTestCase(unittest.TestCase): def setUp(self): self.serializer = PongMessageSerializer() def test_with_id(self): id = 'test' pod = self.serializer.serialize(PongMessage(id=id)) self.assertEqual(pod, {'msg': 'pong', 'id': id}) def test_without_id(self): pod = self.serializer.serialize(PongMessage()) self.assertEqual(pod, {'msg': 'pong'})
class PongMessageSerializerTestCase(unittest.TestCase): def setUp(self): self.serializer = PongMessageSerializer() def test_with_id(self): id = "test" pod = self.serializer.serialize(PongMessage(id=id)) self.assertEqual(pod, {"msg": "pong", "id": id}) def test_without_id(self): pod = self.serializer.serialize(PongMessage()) self.assertEqual(pod, {"msg": "pong"})
def setUp(self): self.serializer = PongMessageSerializer()