Exemplo n.º 1
0
    def test_POST_with_invalid_credentials_renders_login_html(
            self, client, user, test_password):
        data = {'email': user.email, 'password': test_password + 'extra-chars'}

        resp = client.post(self.url, data=data)

        assert_template_is_rendered(resp, 'login.html')
Exemplo n.º 2
0
    def test_POST_with_invalid_data_renders_settings_html_with_errors(
            self, auth_client):
        invalid_data = {}

        resp = auth_client.post(self.url, data=invalid_data)

        assert_template_is_rendered(resp, 'settings.html')
        assert 'This field is required' in str(resp.content)
Exemplo n.º 3
0
    def test_GET_renders_register_html(self, client):
        resp = client.get(self.url)

        assert_template_is_rendered(resp, 'register.html')
Exemplo n.º 4
0
    def test_GET_renders_login_html(self, client):
        resp = client.get(self.url)

        assert_template_is_rendered(resp, 'login.html')
Exemplo n.º 5
0
    def test_GET_renders_settings_html(self, auth_client):
        resp = auth_client.get(self.url)

        assert_template_is_rendered(resp, 'settings.html')
Exemplo n.º 6
0
    def test_GET_renders_watering_station_update_html_template(
            self, auth_client):
        resp = auth_client.get(self.url)

        assertions.assert_template_is_rendered(resp,
                                               'watering_station_update.html')
Exemplo n.º 7
0
    def test_GET_renders_garden_detail_html_template(self, auth_client):
        resp = auth_client.get(self.url)

        assertions.assert_template_is_rendered(resp, 'garden_detail.html')