Exemplo n.º 1
0
    def test_POST_returns_404_page_when_accessed_by_user_who_doesnt_own_the_garden(
            self, auth_client, garden):
        url = self.create_url(garden.pk)

        resp = auth_client.post(url)

        assertions.assert_404_rendered(resp)
Exemplo n.º 2
0
    def test_POST_returns_404_page_when_accessed_by_user_who_doesnt_own_the_garden(
            self, auth_client, garden, watering_station_form_fields):
        url = self.create_url(garden.pk)

        resp = auth_client.post(url, data=watering_station_form_fields)

        assertions.assert_404_rendered(resp)
Exemplo n.º 3
0
    def test_GET_returns_404_page_when_accessed_by_user_who_doesnt_own_the_watering_station(
            self, auth_client, watering_station):
        url = self.create_url(watering_station.garden.pk, watering_station.pk)

        resp = auth_client.get(url)

        assertions.assert_404_rendered(resp)
Exemplo n.º 4
0
    def test_view_redirects_users_who_dont_own_the_watering_station_to_404_page_not_found(
            self, auth_client, watering_station, method):
        url = self.create_url(watering_station.garden.pk, watering_station.pk)

        resp = getattr(auth_client, method)(url)

        assertions.assert_404_rendered(resp)
Exemplo n.º 5
0
    def test_GET_redirects_users_who_dont_own_the_watering_station_to_404_page_not_found(
            self, auth_client, watering_station):
        url = self.create_url(watering_station.garden.pk, watering_station.pk)

        resp = auth_client.get(url)

        assertions.assert_404_rendered(resp)
Exemplo n.º 6
0
    def test_GET_returns_404_page_when_accessing_a_resource_that_doesnt_exist(
            self, auth_client):
        num_watering_stations = self.garden.watering_stations.all().count()
        url = self.create_url(self.garden.pk, num_watering_stations + 1)

        resp = auth_client.get(url)

        assertions.assert_404_rendered(resp)