Пример #1
0
    def test_empty_list(self):
        # pusta lista
        response = self.client.get(self.url)
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(len(response.data), 0)

        # transakcje innego uzytkownika
        patient = PatientFactory.create()
        TransactionFactory.create_batch(20, patient=patient)

        response = self.client.get(self.url)
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(len(response.data), 0)
Пример #2
0
    def test_non_empty_list(self):
        TransactionFactory.create_batch(20, patient=self.patient)

        response = self.client.get(self.url)
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(len(response.data), 20)