Project

Profile

Help

Refactor #93

closed

Make @auth_required testable and write a few examples

Added by bmbouter about 9 years ago. Updated almost 5 years 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.

Actions #1

Updated by mhrivnak about 9 years ago

  • Priority changed from Normal to High
Actions #2

Updated by cduryee about 9 years ago

  • Sprint/Milestone set to 9
Actions #3

Updated by amacdona@redhat.com about 9 years ago

  • Status changed from NEW to ASSIGNED
Actions #4

Updated by rbarlow about 9 years ago

  • Tracker changed from Task to Refactor
Actions #5

Updated by bmbouter about 9 years ago

  • Status changed from ASSIGNED to POST
  • % Done changed from 0 to 90
Actions #6

Updated by bmbouter about 9 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.

Actions #7

Updated by bmbouter about 9 years ago

  • Status changed from POST to MODIFIED

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

Actions #8

Updated by bmbouter about 9 years ago

  • Status changed from MODIFIED to 7
  • % Done changed from 90 to 100
Actions #9

Updated by bmbouter about 9 years ago

  • Status changed from 7 to MODIFIED
  • Platform Release set to master
Actions #10

Updated by rbarlow almost 9 years ago

  • Platform Release changed from master to 2.7.0
Actions #11

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #12

Updated by rbarlow about 8 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #13

Updated by bmbouter about 6 years ago

  • Sprint set to January 2015
Actions #14

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (9)
Actions #15

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF