From cb8f2c48a03c782778591b77fff60b11abe8e0be Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Aug 05 2016 11:48:51 +0000 Subject: Fix test failing due to additional HTML attributes The HTML contains an attribute which causes the expected string to not be found. This patch updates the test to use a regular expression, which should be a tad more reliable. --- diff --git a/hubs/tests/test_fedora_hubs_flask_api.py b/hubs/tests/test_fedora_hubs_flask_api.py index 5ef5732..6808456 100644 --- a/hubs/tests/test_fedora_hubs_flask_api.py +++ b/hubs/tests/test_fedora_hubs_flask_api.py @@ -37,8 +37,8 @@ class HubsAPITest(hubs.tests.APPTest): with tests.auth_set(app, None): # check_auth doesn't load in unittest result = self.app.get('/ralph', follow_redirects=True) self.assertEqual(result.status_code, 200) - str_expected = '
Ralph
' - self.assertTrue(str_expected in result.data) + match_expected = r']*>Ralph' + self.assertRegexpMatches(result.data, match_expected) str_expected = 'Not logged in.' self.assertTrue(str_expected in result.data)