fix tests

This commit is contained in:
wh1te909
2021-05-08 17:27:01 +00:00
parent 314ab9b304
commit 2adcfce9d0
2 changed files with 5 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ class UpdateAgentPerms(permissions.BasePermission):
class EditAgentPerms(permissions.BasePermission):
def has_permission(self, r, view):
return _is_su(r) or r.user.can_edit_agents
return _is_su(r) or r.user.can_edit_agent
class ManageProcPerms(permissions.BasePermission):

View File

@@ -10,9 +10,11 @@ from core.models import CoreSettings
class TacticalTestCase(TestCase):
def authenticate(self):
self.john = User(username="john")
self.john.is_superuser = True
self.john.set_password("hunter2")
self.john.save()
self.alice = User(username="alice")
self.alice.is_superuser = True
self.alice.set_password("hunter2")
self.alice.save()
self.client_setup()
@@ -20,7 +22,8 @@ class TacticalTestCase(TestCase):
def setup_agent_auth(self, agent):
agent_user = User.objects.create_user(
username=agent.agent_id, password=User.objects.make_random_password(60)
username=agent.agent_id,
password=User.objects.make_random_password(60),
)
Token.objects.create(user=agent_user)