Project

Profile

Help

Refactor #93

Make @auth_required testable and write a few examples

Added by bmbouter almost 6 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
2.7.0
Groomed:
Sprint Candidate:
Tags:
Pulp 2
Sprint:
January 2015
Quarter:

Description

This is a task related to the Django conversion work. Currently the testing methodology expects to make assertions about the decorators that are present over each Django URL handler. The decorator currently is not able to be tested without a large number of mock gymnastics. bmbouter has prototyped an adjustment to the decorator whereby the decorators itself calls an external function which can be mocked directly instead of mocking all calls the decorated function calls out to. This works around the central difficulty that decorated functions are stored in a closure and are not able to be mocked directly.

This task is to convert that prototype into production-grade code which includes:
1. Writing a generic replacement function that accepts test-driven assertion values about which permissions should be present when the decorator is called.
2. Use the helper function from (1) to add the desired assertion functionality to some actual Django URL handlers (to provide examples of usage for others).
3. Review the code once more to ensure there are no side effects and that we're good to go.

History

#1 Updated by mhrivnak almost 6 years ago

  • Priority changed from Normal to High

#2 Updated by cduryee almost 6 years ago

  • Sprint/Milestone set to 9

#3 Updated by amacdona@redhat.com almost 6 years ago

  • Status changed from NEW to ASSIGNED

#4 Updated by rbarlow almost 6 years ago

  • Tracker changed from Task to Refactor

#5 Updated by bmbouter almost 6 years ago

  • Status changed from ASSIGNED to POST
  • % Done changed from 0 to 90

#6 Updated by bmbouter almost 6 years ago

This has been merged into the feature branch 'introducing-django' on pulp/pulp, but we need to leave this at POST until the feature branch is merged back into master. This is planned to be done near the end of the Jan 2015 at which point this can be moved to modified.

#7 Updated by bmbouter over 5 years ago

  • Status changed from POST to MODIFIED

Merged to the feature branch 'introducing-django' then to master.

#8 Updated by bmbouter over 5 years ago

  • Status changed from MODIFIED to 7
  • % Done changed from 90 to 100

#9 Updated by bmbouter over 5 years ago

  • Status changed from 7 to MODIFIED
  • Platform Release set to master

#10 Updated by rbarlow over 5 years ago

  • Platform Release changed from master to 2.7.0

#11 Updated by dkliban@redhat.com over 5 years ago

  • Status changed from MODIFIED to 5

#12 Updated by rbarlow over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#13 Updated by bmbouter over 2 years ago

  • Sprint set to January 2015

#14 Updated by bmbouter over 2 years ago

  • Sprint/Milestone deleted (9)

#15 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF