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())
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)