From cfe1b4e8cc63752f52ef21d262f0ca511833d0fa Mon Sep 17 00:00:00 2001 From: heinzel Date: Mon, 4 May 2020 11:38:27 +0200 Subject: [PATCH] FIX: tests: satisfy new version of pylint --- apps/base/tests/test_views.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/base/tests/test_views.py b/apps/base/tests/test_views.py index ed5a682..cab797d 100644 --- a/apps/base/tests/test_views.py +++ b/apps/base/tests/test_views.py @@ -28,15 +28,8 @@ class RootUnitTestCase(unittest.TestCase): real_hostname = socket.gethostname() for test_data in test_data_sets: - if 'hostname' in test_data: - 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 + hostname = test_data.get('hostname', real_hostname) + expected_color_hex = test_data.get('expected_color_hex', default_color_hex) with mock.patch('socket.gethostname', return_value=hostname): view = RootView() -- 2.52.0