Fix intermittent errors affecting CircleCI builds
Created by: itsjeyd
cf. OC-1651
Fixes the following issues affecting CircleCI builds:
-
ConnectionRefusedError
affecting unit tests (not possible to reproduce locally):====================================================================== ERROR: test_get_authenticated (instance.tests.api.test_instance.InstanceAPITestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/redis/connection.py", line 439, in connect sock = self._connect() File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/redis/connection.py", line 494, in _connect raise err File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/redis/connection.py", line 482, in _connect sock.connect(socket_address) ConnectionRefusedError: [Errno 111] Connection refused
-
AssertionError
affecting browser tests (possible to reproduce locally):====================================================================== FAIL: test_invalid_email (registration.tests.browser.browser_registration.BetaTestBrowserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ubuntu/opencraft/registration/tests/test_views.py", line 274, in test_invalid_email 'email': ['Enter a valid email address.'], File "/home/ubuntu/opencraft/registration/tests/test_views.py", line 189, in assert_registration_fails expected_errors) AssertionError: defaultdict(<class 'list'>, {'email': ['This field is required.']}) != {'email': ['Enter a valid email address.']}
-
Another type of
AssertionError
that's not listed on the ticket:====================================================================== FAIL: test_existing_user (registration.tests.browser.browser_registration.BetaTestBrowserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ubuntu/opencraft/registration/tests/test_views.py", line 366, in test_existing_user self._assert_registration_succeeds(form_data) File "/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/factory/django.py", line 339, in wrapper return callable_obj(*args, **kwargs) File "/home/ubuntu/opencraft/registration/tests/test_views.py", line 83, in _assert_registration_succeeds self._assert_success_response(response) File "/home/ubuntu/opencraft/registration/tests/test_views.py", line 104, in _assert_success_response response_body) AssertionError: 'Thank you for applying for the OpenCraft beta' not found in '<!DOCTYPE html> <html ...>...</html>'