Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Yield NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Yield Call AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Str Str Str Str Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Yield AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Assign NameStore ListLoad Dict Str Str Str Str Str Str Dict Str Str Str NameLoad Str Str For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Assign NameStore ListLoad Dict Str Str Str Str Str Str Str Str Dict Str Str Str Str Str Str Str Str For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Num Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore ListLoad Dict Str Str Str Str Num Str Num NameLoad Dict Str Str Str Str Num Str Num Call NameLoad Num NameLoad For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Num Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore ListLoad Dict Str Str Num NameLoad Dict Str Str Num NameLoad Dict Str Num For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Dict Str Str AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Dict Str Str Str Str AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str FunctionDef arguments args defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign AttributeStore NameLoad attr Call NameLoad keyword Dict Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Num Str Num Num Dict Str Str Str Str ListLoad Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str NameLoad Num Str NameLoad Dict Str Str Num Num NameLoad Num Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Num Num Str Str Str NameLoad Num Num Dict Str NameLoad NameLoad Dict Num Str Str Num Num Str Str NameLoad NameLoad NameLoad NameLoad NameLoad Num Num Str Num Num NameLoad NameLoad NameLoad NameLoad NameLoad Str NameLoad NameLoad Dict NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad decorator_list Call AttributeLoad NameLoad attr keyword Str
N/A N/A datetime N/A pytest N/A pytz mock Mock config settings catwatch.app create_app catwatch.lib.util_datetime timedelta_months catwatch.extensions db _db catwatch.blueprints.user.models User catwatch.blueprints.issue.models Issue catwatch.blueprints.billing.models.credit_card CreditCard catwatch.blueprints.billing.models.coupon Coupon catwatch.blueprints.billing.models.subscription Subscription catwatch.blueprints.billing.gateways.stripecom Coupon PaymentCoupon catwatch.blueprints.billing.gateways.stripecom Event PaymentEvent catwatch.blueprints.billing.gateways.stripecom Card PaymentCard catwatch.blueprints.billing.gateways.stripecom Subscription PaymentSubscription catwatch.blueprints.billing.gateways.stripecom Invoice PaymentInvoice app N/A N/A N/A N/A N/A 
    Setup our flask test app, this only gets executed once.

    :return: Flask app
     N/A db_uri N/A N/A {0}_test format N/A settings SQLALCHEMY_DATABASE_URI N/A params N/A DEBUG TESTING WTF_CSRF_ENABLED SQLALCHEMY_DATABASE_URI False True False db_uri N/A _app N/A create_app settings_override params N/A ctx N/A N/A _app app_context N/A N/A N/A ctx push N/A N/A _app N/A N/A N/A ctx pop N/A N/A N/A pytest yield_fixture scope session client N/A N/A app N/A N/A N/A 
    Setup an app client, this gets executed for each test function.

    :param app: Pytest fixture
    :return: Flask app client
     N/A N/A N/A N/A app test_client N/A N/A N/A pytest yield_fixture scope function db N/A N/A app N/A N/A N/A 
    Setup our database, this only gets executed once per session.

    :param app: Pytest fixture
    :return: SQLAlchemy database session
     N/A N/A N/A _db drop_all N/A N/A N/A _db create_all N/A params N/A role email name password admin admin@localhost.com Dev password N/A admin N/A User params N/A N/A N/A N/A _db session add admin N/A N/A N/A N/A _db session commit N/A _db N/A N/A N/A pytest fixture scope session session N/A N/A db N/A N/A N/A 
    Allow very fast tests by using rollbacks and nested sessions. This does
    require that your database supports SQL savepoints, and postgres does.

    Read more about this at:
    http://stackoverflow.com/a/26624146

    :param db: Pytest fixture
    :return: None
     N/A N/A N/A N/A db session begin_nested N/A N/A N/A db session N/A N/A N/A N/A db session rollback N/A N/A N/A pytest yield_fixture scope function token N/A N/A db N/A N/A N/A 
    Serialize a JWS token.

    :param db: Pytest fixture
    :return: JWS token
     N/A user N/A N/A User find_by_identity admin@localhost.com N/A N/A N/A user serialize_token N/A N/A N/A pytest fixture scope session users N/A N/A db N/A N/A N/A 
    Create user fixtures. They reset per test.

    :param db: Pytest fixture
    :return: SQLAlchemy database session
     N/A N/A N/A N/A N/A N/A db session query User delete N/A users N/A N/A role email password admin admin@localhost.com password N/A active email password False disabled@localhost.com password N/A user users N/A N/A N/A N/A N/A db session add N/A User user N/A N/A N/A N/A db session commit N/A db N/A N/A N/A pytest fixture scope function issues N/A N/A db N/A N/A N/A 
    Create issue fixtures. They reset per test.

    :param db: Pytest fixture
    :return: SQLAlchemy database session
     N/A N/A N/A N/A N/A N/A db session query Issue delete N/A issues N/A N/A label email question status login admin@localhost.com 42. unread N/A label email question status billing admin@localhost.com Hello. unread N/A issue issues N/A N/A N/A N/A N/A db session add N/A Issue issue N/A N/A N/A N/A db session commit N/A db N/A N/A N/A pytest fixture scope function credit_cards N/A N/A db N/A N/A N/A 
    Create credit card fixtures. They reset per test.

    :param db: Pytest fixture
    :return: SQLAlchemy database session
     N/A N/A N/A N/A N/A N/A db session query CreditCard delete N/A may_29_2015 N/A N/A datetime date 2015 5 29 N/A june_29_2015 N/A N/A datetime datetime 2015 6 29 0 0 0 N/A june_29_2015 N/A N/A N/A pytz utc localize june_29_2015 N/A credit_cards N/A N/A user_id brand last4 exp_date 1 Visa 4242 june_29_2015 N/A user_id brand last4 exp_date 1 Visa 4242 N/A timedelta_months 12 may_29_2015 N/A card credit_cards N/A N/A N/A N/A N/A db session add N/A CreditCard card N/A N/A N/A N/A db session commit N/A db N/A N/A N/A pytest fixture scope function coupons N/A N/A db N/A N/A N/A 
    Create coupon fixtures. They reset per test.

    :param db: Pytest fixture
    :return: SQLAlchemy database session
     N/A N/A N/A N/A N/A N/A db session query Coupon delete N/A may_29_2015 N/A N/A datetime datetime 2015 5 29 0 0 0 N/A may_29_2015 N/A N/A N/A pytz utc localize may_29_2015 N/A june_29_2015 N/A N/A datetime datetime 2015 6 29 N/A june_29_2015 N/A N/A N/A pytz utc localize june_29_2015 N/A coupons N/A N/A amount_off redeem_by 1 may_29_2015 N/A amount_off redeem_by 1 june_29_2015 N/A amount_off 1 N/A coupon coupons N/A N/A N/A N/A N/A db session add N/A Coupon coupon N/A N/A N/A N/A db session commit N/A db N/A N/A N/A pytest fixture scope function subscriptions N/A N/A db N/A N/A N/A 
    Create subscription fixtures. They reset per test.

    :param db: Pytest fixture
    :return: SQLAlchemy database session
     N/A subscriber N/A N/A User find_by_identity subscriber@localhost.com N/A subscriber N/A N/A N/A N/A subscriber delete N/A N/A N/A N/A N/A N/A db session query Subscription delete N/A params N/A role email name password payment_id admin subscriber@localhost.com Subby password cus_000 N/A admin N/A User params N/A N/A N/A N/A db session add admin N/A N/A N/A N/A db session commit N/A params N/A user_id plan N/A admin id gold N/A subscription N/A Subscription params N/A N/A N/A N/A db session add subscription N/A params N/A user_id brand last4 exp_date N/A admin id Visa 4242 N/A N/A datetime date 2015 6 1 N/A credit_card N/A CreditCard params N/A N/A N/A N/A db session add credit_card N/A N/A N/A N/A db session commit N/A db N/A N/A N/A pytest fixture scope function mock_stripe N/A N/A N/A N/A N/A 
    Mock all of the Stripe API calls.

    :return:
     N/A N/A PaymentCoupon create N/A Mock return_value N/A N/A N/A PaymentCoupon delete N/A Mock return_value N/A N/A N/A PaymentEvent retrieve N/A Mock return_value N/A N/A N/A PaymentCard update N/A Mock return_value N/A N/A N/A PaymentSubscription create N/A Mock return_value N/A N/A N/A PaymentSubscription update N/A Mock return_value N/A N/A N/A PaymentSubscription cancel N/A Mock return_value N/A N/A upcoming_api N/A date id period_start period_end lines subtotal total customer object attempted closed forgiven paid livemode attempt_count amount_due currency starting_balance ending_balance next_payment_attempt webhooks_delivered_at charge discount application_fee subscription tax_percent tax metadata statement_descriptor description receipt_number 1433018770 in_000 1433018770 1433018770 N/A data total_count object url N/A N/A id object type livemode amount currency proration period subscription quantity plan description discountable metadata sub_000 line_item subscription True 0 usd False N/A start end 1433161742 1434371342 None 1 N/A interval name created amount currency id object livemode interval_count trial_period_days metadata statement_descriptor month Gold 1424879591 500 usd gold plan False 1 14 N/A GOLD MONTHLY None True N/A 1 list /v1/invoices/in_000/lines 0 0 cus_000 invoice True True False True False 0 500 usd 0 0 None None None None None sub_000 None None N/A None None None N/A N/A PaymentInvoice upcoming N/A Mock return_value upcoming_api N/A N/A N/A pytest fixture scope session