From 785c413cde0c2b04d28ade0a018a759e06b6c9bf Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Mon, 4 Jan 2016 15:50:26 +0000 Subject: [PATCH] Move and rename macro.html Remove print statements Fix code style --- app/main/forms.py | 4 ---- app/main/views/add_service.py | 2 -- app/templates/{macros.html => components/form-field.html} | 0 app/templates/govuk_template.html | 2 +- tests/app/main/dao/test_service_dao.py | 1 - tests/app/main/views/test_two_factor.py | 1 - 6 files changed, 1 insertion(+), 9 deletions(-) rename app/templates/{macros.html => components/form-field.html} (100%) diff --git a/app/main/forms.py b/app/main/forms.py index 98d82df59..28238e74e 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -89,11 +89,7 @@ class AddServiceForm(Form): service_name = StringField(validators=[DataRequired(message='Please enter your service name')]) def validate_service_name(self, a): - print("a {}".format(a)) - print("self.service_name {}".format(self.service_name.data)) - print("service_names {}".format(self.service_names)) if self.service_name.data in self.service_names: - print('here') raise ValidationError('Service name already exists') diff --git a/app/main/views/add_service.py b/app/main/views/add_service.py index f6d74e7ac..0669b1742 100644 --- a/app/main/views/add_service.py +++ b/app/main/views/add_service.py @@ -9,7 +9,6 @@ from app.main.forms import AddServiceForm @login_required def add_service(): form = AddServiceForm(services_dao.find_all_service_names()) - print("serivce_names {}".format(services_dao.find_all_service_names())) if form.validate_on_submit(): user = users_dao.get_user_by_id(session['user_id']) @@ -17,4 +16,3 @@ def add_service(): return redirect('/dashboard') else: return render_template('views/add-service.html', form=form) -ยง \ No newline at end of file diff --git a/app/templates/macros.html b/app/templates/components/form-field.html similarity index 100% rename from app/templates/macros.html rename to app/templates/components/form-field.html diff --git a/app/templates/govuk_template.html b/app/templates/govuk_template.html index c3a4fa78f..8057ff1d8 100644 --- a/app/templates/govuk_template.html +++ b/app/templates/govuk_template.html @@ -1,4 +1,4 @@ -{%- from "macros.html" import render_field %} +{%- from "components/form-field.html" import render_field %} {% block top_of_page %}{% endblock %} diff --git a/tests/app/main/dao/test_service_dao.py b/tests/app/main/dao/test_service_dao.py index 191e7da56..e023104b8 100644 --- a/tests/app/main/dao/test_service_dao.py +++ b/tests/app/main/dao/test_service_dao.py @@ -71,4 +71,3 @@ def test_should_return_list_of_service_names(notifications_admin, notifications_ actual = services_dao.find_all_service_names() assert actual == expected - diff --git a/tests/app/main/views/test_two_factor.py b/tests/app/main/views/test_two_factor.py index a8b129858..6f0a4bfe3 100644 --- a/tests/app/main/views/test_two_factor.py +++ b/tests/app/main/views/test_two_factor.py @@ -51,7 +51,6 @@ def test_should_login_user_when_multiple_valid_codes_exist(notifications_admin, response = client.post('/two-factor', data={'sms_code': '23456'}) assert response.status_code == 302 - print(user.id) codes = verify_codes_dao.get_codes(user_id=user.id, code_type='sms') # query will only return codes where code_used == False assert len(codes) == 0