Skip to content

Commit

Permalink
Merge branch 'master' into fix-admin-subnet-import
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Oct 6, 2021
2 parents 3840fce + f352f18 commit 09bda63
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ openwisp-ipam
:target: https://pypi.org/project/openwisp-ipam
:alt: PyPI

.. image:: https://requires.io/github/openwisp/openwisp-ipam/requirements.svg?branch=master
:target: https://requires.io/github/openwisp/openwisp-ipam/requirements/?branch=master
.. image:: https://img.shields.io/librariesio/release/github/openwisp/openwisp-ipam
:target: https://libraries.io/github/openwisp/openwisp-ipam#dependencies
:alt: Requirements Status

.. image:: https://github.com/openwisp/openwisp-ipam/raw/master/docs/subnet_demo.gif
Expand Down
2 changes: 2 additions & 0 deletions openwisp_ipam/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ class AbstractIpAddress(TimeStampedEditableModel):

class Meta:
abstract = True
verbose_name = _('IP address')
verbose_name_plural = _('IP addresses')

def __str__(self):
return self.ip_address
Expand Down
2 changes: 2 additions & 0 deletions openwisp_ipam/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class Migration(migrations.Migration):
options={
'abstract': False,
'swappable': swapper.swappable_setting('openwisp_ipam', 'Ipaddress'),
'verbose_name': 'IP address',
'verbose_name_plural': 'IP addresses',
},
bases=(openwisp_users.mixins.ValidateOrgMixin, models.Model),
),
Expand Down
2 changes: 1 addition & 1 deletion openwisp_ipam/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def test_admin_menu_items(self):
for model in models:
with self.subTest(f'test_admin_group_for_{model}_model'):
url = reverse(f'admin:{self.app_label}_{model}_changelist')
self.assertContains(response, f'<a class="mg-link" href="{url}">')
self.assertContains(response, f'class="mg-link" href="{url}"')
with self.subTest('test_ipam_group_is_registered'):
self.assertContains(
response, '<div class="mg-dropdown-label">Ipam </div>', html=True,
Expand Down
2 changes: 1 addition & 1 deletion openwisp_ipam/tests/test_multitenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def test_import_subnet_new_org(self):
10.27.1.1,Monachers
10.27.1.254,Nano Beam 5 19AC"""
user_a = User.objects.get(username='user_a')
user_a.permissions.add(Permission.objects.get(codename='add_organization'))
user_a.user_permissions.add(Permission.objects.get(codename='add_organization'))

with self.subTest('Test import subnet successful for org manager'):
self._login(username='user_a', password='tester')
Expand Down
3 changes: 2 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coveralls
django-extensions>=2.0.7
openwisp-utils[qa]
# TODO: change this when next version of openwisp_utils is released
openwisp-utils[qa] @ https://github.com/openwisp/openwisp-utils/tarball/master
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# TODO: change this when next version of openwisp-users is released
openwisp-users @ https://github.com/openwisp/openwisp-users/tarball/master
django>=3.0,<3.2
swapper~=1.1
xlrd~=1.1
# TODO: change this when next version of openwisp_utils is released
openwisp-utils[rest] @ https://github.com/openwisp/openwisp-utils/tarball/master
django>=3.0.0,<3.2.0
swapper~=1.1.0
xlrd~=1.1.0
django-reversion~=3.0.8
6 changes: 5 additions & 1 deletion tests/openwisp2/sample_ipam/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ class Migration(migrations.Migration):
),
),
],
options={'abstract': False},
options={
'abstract': False,
'verbose_name': 'IP address',
'verbose_name_plural': 'IP addresses',
},
bases=(openwisp_users.mixins.ValidateOrgMixin, models.Model),
),
migrations.AddIndex(
Expand Down
1 change: 1 addition & 0 deletions tests/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'openwisp_utils.admin_theme',
'openwisp_users.accounts',
# all-auth
'django.contrib.sites',
'allauth',
Expand Down

0 comments on commit 09bda63

Please sign in to comment.