def test_list_objectverzoeken(self):
        list_url = reverse(ObjectVerzoek)
        ObjectVerzoekFactory.create_batch(2)

        response = self.client.get(list_url)

        self.assertEqual(response.status_code, status.HTTP_200_OK)

        data = response.json()
        self.assertEqual(len(data), 2)
Esempio n. 2
0
    def test_pagination_page_param(self):
        ObjectVerzoekFactory.create_batch(2)
        url = reverse(ObjectVerzoek)

        response = self.client.get(url, {"page": 1})

        self.assertEqual(response.status_code, status.HTTP_200_OK)
        response_data = response.json()
        self.assertEqual(response_data["count"], 2)
        self.assertIsNone(response_data["previous"])
        self.assertIsNone(response_data["next"])