From 77eeaec1ecdef5f110c69aa767969649e353b22b Mon Sep 17 00:00:00 2001
From: Frederick Muriuki Muriithi
Date: Wed, 28 Feb 2024 11:32:26 +0300
Subject: tests: test with just the message - don't include markup
Markup can, and will change as improvements are made, but the error
messages will not change that often, plus that is what we want to
actually test for, not the markup.
---
tests/qc_app/test_entry.py | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
(limited to 'tests/qc_app/test_entry.py')
diff --git a/tests/qc_app/test_entry.py b/tests/qc_app/test_entry.py
index efc72a5..bfe56ec 100644
--- a/tests/qc_app/test_entry.py
+++ b/tests/qc_app/test_entry.py
@@ -37,12 +37,8 @@ def test_post_notifies_errors_if_no_data_is_provided(client):
"""
response = client.post("/", data={})
assert response.status_code == 400
- assert (
- b'Invalid file type provided.'
- in response.data)
- assert (
- b'No file was uploaded.'
- in response.data)
+ assert b'Invalid file type provided.' in response.data
+ assert b'No file was uploaded.' in response.data
def test_post_with_correct_data(client):
"""
@@ -69,11 +65,9 @@ def test_post_with_correct_data(client):
"request_data,error_message",
(({"filetype": "invalid_choice",
"qc_text_file": uploadable_file_object("no_data_errors.tsv")},
- b'Invalid file type provided.'),
- ({"filetype": "average"},
- b'No file was uploaded.'),
- ({"filetype": "standard-error"},
- b'No file was uploaded.')))
+ b'Invalid file type provided.'),
+ ({"filetype": "average"}, b'No file was uploaded.'),
+ ({"filetype": "standard-error"}, b'No file was uploaded.')))
def test_post_with_missing_or_invalid_data(client, request_data,error_message):
"""
GIVEN: A flask application testing client
--
cgit v1.2.3