Skip to content

Commit d1569ab

Browse files
authored
[change:tests] Added config_app_label in BaseTestNotification
1 parent d6323bb commit d1569ab

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

openwisp_controller/connection/tests/test_notifications.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
class BaseTestNotification:
1919
app_label = "connection"
20+
config_app_label = (
21+
"config" if not os.environ.get("SAMPLE_APP", False) else "sample_config"
22+
)
2023

2124
def setUp(self):
2225
self._create_admin()
@@ -29,10 +32,9 @@ def _generic_notification_test(
2932
self, exp_level, exp_type, exp_verb, exp_message, exp_email_subject
3033
):
3134
n = Notification.objects.first()
32-
config_app = (
33-
"config" if not os.environ.get("SAMPLE_APP", False) else "sample_config"
35+
device_url_path = reverse(
36+
f"admin:{self.config_app_label}_device_change", args=[self.d.id]
3437
)
35-
device_url_path = reverse(f"admin:{config_app}_device_change", args=[self.d.id])
3638
exp_target_link = f"https://example.com{device_url_path}"
3739

3840
self.assertEqual(n.type, exp_type)

0 commit comments

Comments
 (0)