Skip to content

Commit

Permalink
Linting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
terjekv committed Aug 28, 2023
1 parent bcddd54 commit 7e2b28b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions mreg/api/v1/tests/test_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from rest_framework.exceptions import PermissionDenied
from rest_framework.test import APIClient, force_authenticate

from mreg.api.permissions import IsGrantedNetGroupRegexPermission, is_reserved_ip
from mreg.models import Network, Host, Ipaddress
from mreg.api.permissions import IsGrantedNetGroupRegexPermission

from .tests import MregAPITestCase

Expand All @@ -15,9 +14,17 @@ class TestIsGrantedNetGroupRegexPermission(MregAPITestCase):

@mock.patch('mreg.api.permissions.user_is_superuser', return_value=False)
@mock.patch('mreg.api.permissions.user_is_adminuser', return_value=False)
@mock.patch('mreg.api.permissions.IsGrantedNetGroupRegexPermission.has_obj_perm', return_value=False)
@mock.patch('mreg.api.permissions.IsGrantedNetGroupRegexPermission._get_hostname_and_ips', return_value=('hostname', ['ip']))
def test_unhandled_view(self, mock_get_hostname_and_ips, mock_has_obj_perm, mock_is_adminuser, mock_is_superuser):
@mock.patch('mreg.api.permissions.IsGrantedNetGroupRegexPermission.has_obj_perm',
return_value=False)
@mock.patch('mreg.api.permissions.IsGrantedNetGroupRegexPermission._get_hostname_and_ips',
return_value=('hostname', ['ip']))
def test_unhandled_view(
self,
mock_get_hostname_and_ips,
mock_has_obj_perm,
mock_is_adminuser,
mock_is_superuser
):
request = RequestFactory().post('/')
user = mock.Mock()
user.group_list = []
Expand Down

0 comments on commit 7e2b28b

Please sign in to comment.