3
0
Fork 0

feat: add basic Roles view

can't edit user/role/perm mappings yet, just minimal CRUD
This commit is contained in:
Lance Edgar 2024-08-13 10:52:30 -05:00
parent eac3b81918
commit 7ad6a9d5a0
8 changed files with 178 additions and 5 deletions

View file

@ -5,16 +5,15 @@ from unittest.mock import patch
from sqlalchemy import orm
import colander
from pyramid.httpexceptions import HTTPNotFound
from wuttaweb.views import users
from wuttaweb.views import users as mod
from tests.util import WebTestCase
class TestPersonView(WebTestCase):
class TestUserView(WebTestCase):
def make_view(self):
return users.UserView(self.request)
return mod.UserView(self.request)
def test_get_query(self):
view = self.make_view()
@ -45,7 +44,7 @@ class TestPersonView(WebTestCase):
self.session.add(user)
self.session.commit()
with patch.object(users, 'Session', return_value=self.session):
with patch.object(mod, 'Session', return_value=self.session):
# invalid if same username in data
node = colander.SchemaNode(colander.String(), name='username')