def assert_attribute(self, expected, attribute, **data): payload = ConfirmationPayload(data) result = getattr(payload, attribute) self.assertEqual( expected, result, '{attribute} not equal to {expected} but {result}'.format( attribute=attribute, expected=expected, result=result))
def test_get_item(self): payload = ConfirmationPayload(CONFIRMATION_DATA) for key, value in CONFIRMATION_DATA.items(): self.assertEqual(value, payload[key])
def test_payload(self): payload = ConfirmationPayload(CONFIRMATION_DATA) self.assertEqual(payload.data, CONFIRMATION_DATA)