From ff00058847d5541af040f51947f85cc78a793920 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 25 May 2017 15:03:49 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20hit=20template=20preview=20app?= =?UTF-8?q?=20when=20running=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s annoying for tests to pass locally because the template preview app is running locally, but fail on Jenkins because the template preview app doesn’t exist. This commit changes it’s hostname to use a dummy port in tests. --- app/config.py | 1 + tests/app/test_template_previews.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/config.py b/app/config.py index 53eb1e8ac..1a462df1c 100644 --- a/app/config.py +++ b/app/config.py @@ -98,6 +98,7 @@ class Test(Development): WTF_CSRF_ENABLED = False CSV_UPLOAD_BUCKET_NAME = 'test-notifications-csv-upload' NOTIFY_ENVIRONMENT = 'test' + TEMPLATE_PREVIEW_API_HOST = 'http://localhost:9999' class Preview(Config): diff --git a/tests/app/test_template_previews.py b/tests/app/test_template_previews.py index 8c8200576..e1088bbdf 100644 --- a/tests/app/test_template_previews.py +++ b/tests/app/test_template_previews.py @@ -29,15 +29,15 @@ def test_from_utils_template_calls_through( @pytest.mark.parametrize('partial_call, expected_url', [ ( partial(TemplatePreview.from_database_object, filetype='bar'), - 'http://localhost:6013/preview.bar', + 'http://localhost:9999/preview.bar', ), ( partial(TemplatePreview.from_database_object, filetype='baz'), - 'http://localhost:6013/preview.baz', + 'http://localhost:9999/preview.baz', ), ( partial(TemplatePreview.from_database_object, filetype='bar', page=99), - 'http://localhost:6013/preview.bar?page=99', + 'http://localhost:9999/preview.bar?page=99', ), ]) def test_from_database_object_makes_request(