Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2003 (closed defect: invalid)

Opened 11 years ago

Last modified 11 years ago

[TEST] Custom identity provider not available in unittest

Reported by: kvdb Owned by: kskuhlman
Priority: normal Milestone: 1.1b2
Component: Tests Version: 1.1 HEAD
Severity: normal Keywords:
Cc:

Description

I'm using a custom identity provider. (Added to setup.py and entry_points.txt) While using my CMS with the generated quickstart startup script, it works fine.

However, when running unittests (see test.py), the framework is unable to find the identity provider (see dump.txt)

Attachments

test.py Download (478 bytes) - added by kvdb 11 years ago.
dump.txt Download (3.0 KB) - added by kvdb 11 years ago.

Change History

Changed 11 years ago by kvdb

Changed 11 years ago by kvdb

comment:1 Changed 11 years ago by chrisz

I stumbled upon the same problem and noticed that when I run the tests with "pyhton setup.py test", everything works, the problem appears only with nosetests.

comment:2 Changed 11 years ago by kskuhlman

  • Owner changed from faide to kskuhlman
  • Summary changed from Custom identity provider not available in unittest to [TEST] Custom identity provider not available in unittest
  • Component changed from TurboGears to Tests
  • Milestone changed from 1.1 to 1.1 beta 2

Nice test. Thank you very much.

BTW, you don't need the setUp method. TGTest will create the app attribute from self.root. Let me know if you think I need to clarify the documentation on that (or feel free to do so yourself.)

comment:3 Changed 11 years ago by faide

shall we mark this as invalid since it works with "python setup.py test" ?

comment:4 Changed 11 years ago by kvdb

The test framework seems to work better by using "python setup.py test". So, marking it invalid is fine with me. However  http://docs.turbogears.org/1.1/Testing still talks about nosetests without mentioning "python setup.py test". The page is immutable, so I thought I'd mention it here in this bug report.

With this new "python setup.py test" way of testing, I got another 'blocker' right away. I'll update to a later TG (currently using 1.1r5330) and file a new bugreport if I can still reproduce it.

======================================================================
FAIL: test_get_signup_form (cms.signup.tests.test_account_signup.TestAccountSignup)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kvdb/ivy/trunk/src/cms/cms/signup/tests/test_account_signup.py", line 15, in test_get_signup_form
    response = self.app.get('/signup')
  File "/home/kvdb/ivy/env/ivy_tg1.1_r5330/lib/python2.5/site-packages/WebTest-1.0-py2.5.egg/webtest/__init__.py", line 149, in get
  File "/home/kvdb/ivy/env/ivy_tg1.1_r5330/lib/python2.5/site-packages/WebTest-1.0-py2.5.egg/webtest/__init__.py", line 301, in do_request
  File "build/bdist.linux-i686/egg/webob/__init__.py", line 1300, in get_response
  File "build/bdist.linux-i686/egg/webob/__init__.py", line 1272, in call_application
  File "/usr/lib/python2.5/wsgiref/validate.py", line 176, in lint_app
    iterator = application(environ, start_response_wrapper)
  File "/home/kvdb/ivy/env/ivy_tg1.1_r5330/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cpwsgi.py", line 149, in wsgiApp
    start_response(s, h, exc)
  File "/usr/lib/python2.5/wsgiref/validate.py", line 166, in start_response_wrapper
    check_headers(headers)
  File "/usr/lib/python2.5/wsgiref/validate.py", line 405, in check_headers
    % (value, bad_header_value_re.search(value).group(0)))
  File "/usr/lib/python2.5/wsgiref/validate.py", line 129, in assert_
    raise AssertionError(*args)
AssertionError: Bad header value: 'session_id=938a4e5e46a0794880f264594e23a8042ae64ab6; expires=Thu, 13 Nov 2008 11:46:39 GMT; Path=/\r' (bad char: '\r')

----------------------------------------------------------------------

comment:5 Changed 11 years ago by Chris Arndt

Can you post the code for this test? It seems that the session cookie has a CR char in the path option. I'm not sure how this could happen. Maybe you test code will clarify. Maybe you should also post your application config.

comment:6 Changed 11 years ago by Chris Arndt

Come to think of it, since this seems to be a different problem, you should discuss this on the mailing list.

comment:7 Changed 11 years ago by faide

  • Status changed from new to closed
  • Resolution set to invalid

Closing this ticket as invalid since we now have another set of problems. Please open a new ticket if you need to.

I updated the documentation to refer to setup.py test instead of nosetests.

Note: See TracTickets for help on using tickets.