Skip to content

Commit

Permalink
Merge branch 'master' into issues/34-Add-scoped_throttling
Browse files Browse the repository at this point in the history
  • Loading branch information
ManishShah120 committed Jan 6, 2021
2 parents 441684d + b130a44 commit e560c02
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
18 changes: 18 additions & 0 deletions openwisp_ipam/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,21 @@ def test_operator_group_permission(self):
perms = list(operator.permissions.values_list('codename', flat=True))
for p in operator_permissions:
self.assertIn(p, perms)

def test_admin_menu_items(self):
# Test menu items (openwisp-utils menu) for Subnet and IpAddress models
response = self.client.get(reverse('admin:index'))
self.assertContains(
response,
'<a href="{}" class="subnet">subnets</a>'.format(
reverse(f'admin:{self.app_label}_subnet_changelist')
),
html=True,
)
self.assertContains(
response,
'<a href="{}" class="ipaddress">ip addresss</a>'.format(
reverse(f'admin:{self.app_label}_ipaddress_changelist')
),
html=True,
)
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
coveralls
django-extensions>=2.0.7
openwisp-utils[qa]~=0.6.0
openwisp-utils[qa]~=0.7.2
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
openwisp-users~=0.4.1
openwisp-utils[rest]~=0.6.0
openwisp-users~=0.5.1
openwisp-utils[rest]~=0.7.2
django>=2.2,<3.2
swapper~=1.1
xlrd~=1.1
Expand Down
1 change: 1 addition & 0 deletions tests/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'openwisp_utils.admin_theme.context_processor.menu_items',
],
},
},
Expand Down

0 comments on commit e560c02

Please sign in to comment.