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 #1166 (closed enhancement: fixed)

Opened 12 years ago

Last modified 11 years ago

[PATCH] Support testing the code that uses identity

Reported by: max Owned by: anonymous
Priority: normal Milestone:
Component: unassigned Version: 1.0b1
Severity: normal Keywords:
Cc:

Description

Right now, there is no easy way to test your code with testutil.createRequest or testutil.call if the code under test make use of turbogears.identity.

The patch included adds new methods to testutil module so that identity can be set while executing a request. It also adds new method to the IdentityProvider? to be able to configure identity current in a way needed for test fixture.

Attachments

test_id.patch Download (2.8 KB) - added by max 12 years ago.

Change History

Changed 12 years ago by max

comment:1 Changed 12 years ago by max

Let me know if it's OK and I'll commit it.

comment:2 Changed 12 years ago by max

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

Applied the patch both to trunk and to 1.0 branch (r2258).

comment:3 Changed 12 years ago by max

Crude docs:

The patch adds a couple of new methods.

testutil.set_identity_user method allows you to set user for requests executed eventuall with testutil.call or testutil.create_request. This method uses new Identity API, authenticated_identity which allows you to set idenitity.current.user directly, instead of normal authentication process.

Note: See TracTickets for help on using tickets.