Module Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad handlers ExceptHandler type NameLoad body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Return If Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num orelse Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore Str Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot Call AttributeLoad NameLoad attr body Return Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore Str Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Call NameLoad keyword Str keyword Str ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Assign NameStore Call NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore IfExp CompareGtE AttributeLoad NameLoad attr TupleLoad Num Num UnaryOpNot AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad Str FunctionDef arguments args NameParam NameParam defaults body Raise Call NameLoad Str Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad keyword Call NameLoad keyword AttributeLoad NameLoad attr keyword Str keyword AttributeLoad NameLoad attr Return NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Assign NameStore Call NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareIn Str NameLoad Expr Call AttributeLoad NameLoad attr CompareIn Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr CompareIn Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr CompareIn Str SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Raise Call NameLoad decorator_list decorator_list Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Assign NameStore Call Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Raise Call NameLoad decorator_list decorator_list Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad BinOpMod Str NameLoad decorator_list decorator_list
N/A N/A django django.core mail django.contrib.auth.models User django.conf settings django.template loader TemplateDoesNotExist django.http HttpRequest HttpResponse django.utils simplejson test TestCase models Consumer handler BaseHandler utils rc resource Resource ConsumerTest N/A TestCase N/A N/A fixtures N/A models.json setUp N/A N/A self N/A N/A N/A N/A self consumer N/A Consumer N/A N/A N/A self consumer name Piston Test Consumer N/A N/A N/A self consumer description A test consumer for Piston. N/A N/A N/A self consumer user N/A N/A N/A User objects get pk 3 N/A N/A N/A N/A self consumer generate_random_codes N/A _pre_test_email N/A N/A self N/A N/A N/A template N/A piston/mails/consumer_%s.txt N/A N/A self consumer status N/A N/A N/A N/A N/A loader render_to_string template N/A consumer user N/A self consumer N/A N/A self consumer user N/A True N/A N/A N/A TemplateDoesNotExist N/A N/A 
            They haven't set up the templates, which means they might not want
            these emails sent.
             N/A False N/A test_create_pending N/A N/A self N/A N/A N/A  Ensure creating a pending Consumer sends proper emails  N/A N/A N/A N/A self _pre_test_email N/A N/A N/A N/A len N/A settings ADMINS N/A N/A N/A N/A self assertEquals N/A len N/A mail outbox 2 N/A N/A N/A N/A self assertEquals N/A len N/A mail outbox 1 N/A expected Your API Consumer for example.com is awaiting approval. N/A N/A N/A self assertEquals N/A N/A N/A mail outbox N/A 0 subject expected N/A test_delete_consumer N/A N/A self N/A N/A N/A  Ensure deleting a Consumer sends a cancel email  N/A N/A mail outbox N/A N/A N/A N/A N/A self consumer delete N/A N/A N/A N/A self _pre_test_email N/A N/A N/A N/A N/A self assertEquals N/A len N/A mail outbox 1 N/A expected Your API Consumer for example.com has been canceled. N/A N/A N/A self assertEquals N/A N/A N/A mail outbox N/A 0 subject expected N/A N/A CustomResponseWithStatusCodeTest N/A TestCase N/A N/A 
     Test returning content to be formatted and a custom response code from a 
     handler method. In this case we're returning 201 (created) and a dictionary 
     of data. This data will be formatted as json. 
      test_reponse_with_data_and_status_code N/A N/A self N/A N/A N/A response_data N/A dict complex_response N/A dict something good something_else great MyHandler N/A BaseHandler N/A N/A 
             Handler which returns a response w/ both data and a status code (201)
              N/A allowed_methods N/A POST create N/A N/A self request N/A N/A N/A resp N/A rc CREATED N/A N/A resp content response_data N/A resp N/A N/A N/A resource N/A Resource MyHandler N/A request N/A HttpRequest N/A N/A request method POST N/A response N/A resource request emitter_format json N/A N/A N/A self assertEquals 201 N/A response status_code N/A is_string N/A N/A N/A django VERSION N/A 1 4 N/A N/A response _base_content_is_iter N/A response _is_string N/A N/A N/A self assert_ is_string Expected response content to be a string N/A N/A N/A self assertEquals response_data N/A N/A simplejson loads N/A response content N/A N/A ErrorHandlerTest N/A TestCase N/A test_customized_error_handler N/A N/A self N/A N/A N/A 
        Throw a custom error from a handler method and catch (and format) it 
        in an overridden error_handler method on the associated Resource object
         GoAwayError N/A Exception N/A __init__ N/A N/A self name reason N/A N/A N/A N/A self name name N/A N/A self reason reason N/A N/A MyHandler N/A BaseHandler N/A N/A 
            Handler which raises a custom exception 
             N/A allowed_methods N/A GET read N/A N/A self request N/A N/A N/A N/A GoAwayError Jerome No one likes you N/A N/A MyResource N/A Resource N/A error_handler N/A N/A self error request meth em_format N/A N/A N/A N/A isinstance error GoAwayError N/A N/A response N/A rc FORBIDDEN N/A N/A response content N/A dict error N/A dict name N/A error name message Get out of here and dont come back reason N/A error reason N/A response N/A N/A N/A N/A super MyResource self error_handler error request meth N/A N/A N/A resource N/A MyResource MyHandler N/A request N/A HttpRequest N/A N/A request method GET N/A response N/A resource request emitter_format json N/A N/A N/A self assertEquals 401 N/A response status_code N/A response_data N/A N/A simplejson loads N/A response content N/A N/A N/A self assertTrue N/A error response_data N/A N/A N/A self assertTrue N/A name N/A response_data N/A error N/A N/A N/A self assertTrue N/A message N/A response_data N/A error N/A N/A N/A self assertTrue N/A reason N/A response_data N/A error N/A test_type_error N/A N/A self N/A N/A N/A 
        Verify that type errors thrown from a handler method result in a valid 
        HttpResonse object being returned from the error_handler method
         MyHandler N/A BaseHandler N/A read N/A N/A self request N/A N/A N/A N/A TypeError N/A N/A N/A request N/A HttpRequest N/A N/A request method GET N/A response N/A N/A Resource MyHandler request N/A N/A N/A self assertTrue N/A isinstance response HttpResponse N/A Expected a response, not: %s response N/A test_other_error N/A N/A self N/A N/A N/A 
        Verify that other exceptions thrown from a handler method result in a valid
        HttpResponse object being returned from the error_handler method
         MyHandler N/A BaseHandler N/A read N/A N/A self request N/A N/A N/A N/A Exception N/A N/A N/A resource N/A Resource MyHandler N/A N/A resource display_errors True N/A N/A resource email_errors False N/A request N/A HttpRequest N/A N/A request method GET N/A response N/A resource request N/A N/A N/A self assertTrue N/A isinstance response HttpResponse N/A Expected a response, not: %s response N/A N/A