The web framework that scales with you. TurboGears 2.4.3 released https://github.com/TurboGears/tg2/releases/tag/tg2.4.3
brondsem on master
add type annotation for update_… Fix double-patching issue that … test on python 3.10 and 3.11 and 1 more (compare)
brondsem on master
#39 remove a py2 __unicode__ me… (compare)
brondsem on 0.12.0
brondsem on master
[#39] Removal of __future__ imp… [#39] pyupgrade --py37-plus run [#39] remove six dependency and 4 more (compare)
brondsem on master
helper to replace session - fro… test improvements - from #45 (compare)
setUp
, so it means it's outside of any request. The transaction manager is not involved.
super().setUp()
does call setup-app
which does commit the transaction that is using to initialize the database (see websetup/schema.py
and websetup/bootstrap.py
both of those commit a transaction)
try:
u = model.User(user_name="what",email_address="what@where.whatever")
model.DBSession.add(u)
except:
transaction.abort()
else:
transaction.commit()
self.app.get(....)
then that triggers request
@require(predicated.not_anonymous())
and the response from self.app.get("/the_url",extra_environ={'REMOTE_USER':'test_user'},response=200)
is always a 401.
@jknapka I suggest you verify the controller from which you are inheriting. There is a class attribute application_under_test
(or something similar) that specified which configuration should be used to create the application instance used for the tests.
By default there are two applications configured in test.ini
the main
and mainnoauth
(or something similar).
The noauth
one supports faking authentication with the REMOTE_USER
, while the other one requires you do to a self.app.post('/login_handler')
to actually log before your can call authenticated endpoints
main_without_authn
the app name that accepts REMOTE_USER
, just checked the name)