Modify

Opened 5 years ago

Closed 5 years ago

#13747 closed defect (fixed)

Test failures with trac 1.4

Reported by: Paul Howarth Owned by: Ryan J Ollos
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.4

Description

Passes with 1.2.4, fails with 1.4:

======================================================================
ERROR: test_approval_admin_keep_perm (acct_mgr.tests.api.AccountManagerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/api.py", line 81, in test_approval_admin_keep_perm
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_approval_user_strip_perm (acct_mgr.tests.api.AccountManagerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/api.py", line 101, in test_approval_user_strip_perm
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_failed_count (acct_mgr.tests.guard.AccountGuardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 32, in setUp
    self.session = self._create_session(self.user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 51, in _create_session
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_functional (acct_mgr.tests.guard.AccountGuardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 32, in setUp
    self.session = self._create_session(self.user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 51, in _create_session
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_lock_count (acct_mgr.tests.guard.AccountGuardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 32, in setUp
    self.session = self._create_session(self.user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 51, in _create_session
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_lock_time (acct_mgr.tests.guard.AccountGuardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 32, in setUp
    self.session = self._create_session(self.user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 51, in _create_session
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_release_time (acct_mgr.tests.guard.AccountGuardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 32, in setUp
    self.session = self._create_session(self.user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 51, in _create_session
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_user_locked (acct_mgr.tests.guard.AccountGuardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 32, in setUp
    self.session = self._create_session(self.user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/guard.py", line 51, in _create_session
    req.session = Session(self.env, req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_last_seen (acct_mgr.tests.model.ModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/model.py", line 58, in test_last_seen
    self._create_session(user)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/model.py", line 50, in _create_session
    self.req.session = Session(self.env, self.req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_user_known (acct_mgr.tests.model.ModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/model.py", line 75, in test_user_known
    self._create_session(user, False)
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/model.py", line 50, in _create_session
    self.req.session = Session(self.env, self.req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_check (acct_mgr.tests.register.EmailVerificationModuleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/register.py", line 370, in setUp
    self.req.session = Session(self.env, self.req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_check_email_used (acct_mgr.tests.register.EmailVerificationModuleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/register.py", line 370, in setUp
    self.req.session = Session(self.env, self.req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

======================================================================
ERROR: test_check_no_email (acct_mgr.tests.register.EmailVerificationModuleTestCase)
----------------------------------------------------------------------
Issue with UID changer for TracAnnouncer (No module named announcer): skipping acct_mgr.opt.tests.announcer
Issue with UID changer for TracForms (No module named tracforms): skipping acct_mgr.opt.tests.tracforms
Issue with UID changer for TracScreenshots (No module named tracscreenshots): skipping acct_mgr.opt.tests.tracscreenshots
Issue with UID changer for TracVote (No module named tracvote): skipping acct_mgr.opt.tests.tracvote
Traceback (most recent call last):
  File "/builddir/build/BUILD/TracAccountManager-0.6dev-r17619/acct_mgr/tests/register.py", line 370, in setUp
    self.req.session = Session(self.env, self.req)
  File "/usr/lib/python2.7/site-packages/trac/web/session.py", line 266, in __init__
    if not req.is_authenticated:
AttributeError: 'Mock' object has no attribute 'is_authenticated'

----------------------------------------------------------------------
Ran 92 tests in 1.326s

FAILED (errors=13)
Test failed: <unittest.runner.TextTestResult run=92 errors=13 failures=0>

I have a patch that fixes this but I'm not sure it's the best way of doing it.

Attachments (1)

TracAccountManager-0.6dev-r17619-test.patch (4.1 KB) - added by Paul Howarth 5 years ago.
Patch to fix test suite for trac 1.4, doesn't break 1.2

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by Paul Howarth

Patch to fix test suite for trac 1.4, doesn't break 1.2

comment:1 Changed 5 years ago by Ryan J Ollos

Status: newaccepted

comment:2 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 17669:

TracAccountManager 0.6dev: Fix test failures with Trac 1.4

Fixes #13747.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.