Ejemplo n.º 1
0
    def test_list_bug_335(self):
        """Ensure we retrieve the embedded series project once."""
        series = create_series()
        create_covers(5, series=series)

        with self.assertNumQueries(3):
            self.client.get(self.api_url())
Ejemplo n.º 2
0
    def test_redirect(self):
        covers = create_covers()
        cover_id = covers[0].id

        requested_url = reverse('patch-detail', kwargs={'patch_id': cover_id})
        redirect_url = reverse('cover-detail', kwargs={'cover_id': cover_id})

        response = self.client.post(requested_url)
        self.assertRedirects(response, redirect_url)
Ejemplo n.º 3
0
    def test_redirect(self):
        covers = create_covers()
        cover_id = covers[0].id

        requested_url = reverse('patch-detail', kwargs={'patch_id': cover_id})
        redirect_url = reverse('cover-detail', kwargs={'cover_id': cover_id})

        response = self.client.post(requested_url)
        self.assertRedirects(response, redirect_url)