def test_success(self): mommy.save_one(Course) mommy.save_one(Course) json_response = rest.index() context = json_response.context self.assertEqual(2, len(context)) course_dct = context[0] self.assertSetEqual(set(['id', 'creation', 'nome']), set(course_dct.iterkeys())) self.assert_can_serialize_as_json(json_response)
def test_sucesso(self): mommy.save_one(Course) resposta = rest.index() self.assert_can_serialize_as_json(resposta)