Compare commits

3 Commits

Author SHA1 Message Date
246d07cf6e Merge branch 'master' of python/django-test into production
All checks were successful
buildbot/python3-test Build done.
buildbot/python2-test Build done.
2019-10-25 17:03:41 +02:00
2f46c814c6 Merge branch 'master' of python/django-test into production
All checks were successful
buildbot/python3-test Build done.
buildbot/python2-test Build done.
2019-10-25 11:46:41 +02:00
eac6bd2103 Merge branch 'master' of python/django-test into production
All checks were successful
buildbot/django-test-test-python2 Build done.
buildbot/django-test-test-python3 Build done.
2019-10-17 13:36:11 +02:00

View File

@@ -28,8 +28,15 @@ class RootUnitTestCase(unittest.TestCase):
real_hostname = socket.gethostname() real_hostname = socket.gethostname()
for test_data in test_data_sets: for test_data in test_data_sets:
hostname = test_data.get('hostname', real_hostname) if 'hostname' in test_data:
expected_color_hex = test_data.get('expected_color_hex', default_color_hex) hostname = test_data['hostname']
else:
hostname = real_hostname
if 'expected_color_hex' in test_data:
expected_color_hex = test_data['expected_color_hex']
else:
expected_color_hex = default_color_hex
with mock.patch('socket.gethostname', return_value=hostname): with mock.patch('socket.gethostname', return_value=hostname):
view = RootView() view = RootView()