Skip to content

Commit 2d4afea

Browse files
committed
[tests] Added tests for multi-tenant admin
1 parent 5d3239e commit 2d4afea

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

openwisp_controller/config/migrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def assign_permissions_to_groups(apps, schema_editor):
2727
create_default_permissions(apps, schema_editor)
2828
operators_and_admins_can_change = ['device', 'config', 'template']
2929
operators_read_only_admins_manage = ['vpn']
30-
manage_operations = ['add', 'change', 'delete']
30+
manage_operations = ['add', 'change', 'view', 'delete']
3131
Group = get_swapped_model(apps, 'openwisp_users', 'Group')
3232

3333
try:

openwisp_controller/config/tests/test_api.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -658,15 +658,6 @@ def test_operator_access_shared_template(self):
658658
update_payload={'name': 'updated-test'},
659659
expected_count=1,
660660
token=token,
661-
expected_status_codes={
662-
'create': 400,
663-
'list': 200,
664-
'retrieve': 403,
665-
'update': 403,
666-
'delete': 403,
667-
'head': 403,
668-
'option': 200,
669-
},
670661
)
671662

672663
def test_org_admin_create_template_with_shared_vpn(self):
@@ -689,16 +680,16 @@ def test_org_admin_create_template_with_shared_vpn(self):
689680
create_payload=create_payload,
690681
update_payload=update_payload,
691682
expected_count=1,
683+
token=self._obtain_auth_token(test_user),
692684
expected_status_codes={
693685
'create': 201,
694686
'list': 200,
695687
'retrieve': 200,
696688
'update': 200,
697689
'delete': 204,
698-
'head': 403,
690+
'head': 200,
699691
'option': 200,
700-
},
701-
token=self._obtain_auth_token(test_user),
692+
}
702693
)
703694

704695
def test_template_create_with_empty_config(self):

openwisp_controller/connection/api/serializers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class Meta:
5151

5252
class CredentialSerializer(BaseSerializer):
5353
params = serializers.JSONField()
54-
include_shared = True
5554

5655
class Meta:
5756
model = Credentials

openwisp_controller/geo/migrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def assign_permissions_to_groups(apps, schema_editor):
77
create_default_permissions(apps, schema_editor)
88
operators_and_admins_can_change = ['location', 'floorplan', 'devicelocation']
9-
manage_operations = ['add', 'change', 'delete']
9+
manage_operations = ['add', 'change', 'view', 'delete']
1010
Group = get_swapped_model(apps, 'openwisp_users', 'Group')
1111

1212
try:

0 commit comments

Comments
 (0)