コード例 #1
0
ファイル: test__User.py プロジェクト: ped-alm/Dito_Challenge
    def asserts_user_get_id_result(self, user_id, user_name, user_email):
        response = RequestsClient().get(self.url + '{id}/'.format(id=user_id))
        response_data = response.json()

        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(response_data['id'], user_id)
        self.assertEqual(response_data['name'], user_name)
        self.assertEqual(response_data['email'], user_email)
コード例 #2
0
    def asserts_event_data_get_id_result(self, event_data_id, event_data,
                                         event_data_datetime):
        response = RequestsClient().get(self.url +
                                        '{id}/'.format(id=event_data_id))
        response_data = response.json()

        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(response_data['id'], event_data_id)
        self.assertEqual(response_data['event'], event_data)
        self.assertEqual(response_data['dateTime'], event_data_datetime)
        self.assertEqual(response_data['user'], self.user.id)
コード例 #3
0
ファイル: test__User.py プロジェクト: ped-alm/Dito_Challenge
    def test_user_get(self):
        response = RequestsClient().get(self.url)
        response_data = response.json()

        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertTrue(len(response_data), User.objects.count())
コード例 #4
0
    def test_data_treat_get(self):
        response = RequestsClient().get(self.url)
        response_result = response.json()

        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertJSONEqual(json.dumps(response_result), json.dumps(self.expected_response))