3
0
Fork 0

fix: make some tweaks for better tailbone compatibility

this is the result of minimally testing the PersonView from wutta,
configured via a tailbone app.

had to add the `view_profile()` stub, pretty sure we want that..?
This commit is contained in:
Lance Edgar 2024-08-15 02:10:08 -05:00
parent 058632ebeb
commit be8a45e543
11 changed files with 137 additions and 33 deletions

View file

@ -6,7 +6,7 @@ from unittest.mock import MagicMock, patch
from pyramid import testing
from pyramid.response import Response
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from pyramid.httpexceptions import HTTPNotFound
from wuttjamaican.conf import WuttaConfig
from wuttaweb.views import master
@ -942,7 +942,7 @@ class TestMasterView(WebTestCase):
configure_get_simple_settings=MagicMock(return_value=settings)):
# get the form page
response = view.configure()
response = view.configure(session=self.session)
self.assertIsInstance(response, Response)
# post request to save settings
@ -952,9 +952,9 @@ class TestMasterView(WebTestCase):
'wutta.foo': 'bar',
'wutta.flag': 'true',
}
response = view.configure()
response = view.configure(session=self.session)
# nb. should get redirect back to configure page
self.assertIsInstance(response, HTTPFound)
self.assertEqual(response.status_code, 302)
# should now have 5 settings
count = self.session.query(model.Setting).count()
@ -970,9 +970,9 @@ class TestMasterView(WebTestCase):
# post request to remove settings
self.request.method = 'POST'
self.request.POST = {'remove_settings': '1'}
response = view.configure()
response = view.configure(session=self.session)
# nb. should get redirect back to configure page
self.assertIsInstance(response, HTTPFound)
self.assertEqual(response.status_code, 302)
# should now have 0 settings
count = self.session.query(model.Setting).count()