Module Expr Str ImportFrom alias alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias identifier Assign NameStore ListLoad Dict Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Dict Str ListLoad Str Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Dict Str ListLoad Str ListLoad Num Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Dict Str ListLoad Str ListLoad Num Num Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Dict Str ListLoad Str ListLoad Num Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Dict Str ListLoad Str ListLoad Num Str Str Dict Str Str Str Str Dict Str Str Str Str Str Dict Str ListLoad Str ListLoad Num Str Dict Str Str Str Str Str Str Str Dict Str Str Str Dict Str ListLoad Str Str ListLoad Num Str FunctionDef arguments args defaults body Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Return NameLoad Return Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Str BoolOpOr AttributeLoad NameLoad attr Str BoolOpOr AttributeLoad NameLoad attr Str decorator_list decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Num Assign NameStore Dict Str Str Call NameLoad Num Dict Str Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assert CompareIs NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Num Assign NameStore Dict Str Str Call NameLoad Num Dict Str Str Num Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assert CompareIs NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Num Assign NameStore Dict Str Str Call NameLoad Num Dict Str Str Num Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assert CompareIs NameLoad NameLoad decorator_list Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Dict Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assert CompareEq Call NameLoad NameLoad ListLoad decorator_list NameLoad FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assert CompareEq Call NameLoad NameLoad ListLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad Call NameLoad keyword Num keyword Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Num Str Assert CompareEq Call NameLoad NameLoad ListLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Num Str Assert CompareNotEq Call NameLoad NameLoad ListLoad decorator_list NameLoad Call NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Num Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list NameLoad Call NameLoad Str FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Num With Call NameLoad Str NameStore body Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad Call NameLoad keyword Num keyword Str With Call NameLoad Str NameStore body Assign AttributeStore NameLoad attr NameLoad With Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Num With Call NameLoad Str NameStore body Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad Call NameLoad keyword Num keyword Str With Call NameLoad Str NameStore body Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad Str decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Return Call NameLoad Str decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Lambda arguments args NameParam NameParam defaults Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list Call AttributeLoad NameLoad attr keyword NameLoad
N/A N/A Defines unit tests for h.notifier. mock patch Mock N/A pytest pyramid.testing DummyRequest h.api storage h.notification reply_template rt N/A store_fake_data N/A N/A id created document group text permissions uri user 0 2013-10-27T19:40:53.245691+00:00 N/A title How to reach the ark NOW? __world__ The animals went in two by two, hurrah! hurrah! N/A read N/A group:__world__ www.howtoreachtheark.now acct:elephant@nomouse.pls N/A id created document group text permissions references uri user 1 2014-10-27T19:50:53.245691+00:00 N/A title How to reach the ark NOW? __world__ The animals went in three by three, hurrah! hurrah N/A read N/A group:__world__ N/A 0 www.howtoreachtheark.now acct:wasp@stinger.rulz N/A id created document group text permissions references uri user 2 2014-10-27T19:55:53.245691+00:00 N/A title How to reach the ark NOW? __world__ The animals went in four by four, hurrah! hurrah N/A read N/A group:__world__ N/A 0 1 www.howtoreachtheark.now acct:hippopotamus@stucked.sos N/A id created document group text permissions references uri user 3 2014-10-27T20:40:53.245691+00:00 N/A title How to reach the ark NOW? __world__ The animals went in two by two, hurrah! hurrah! N/A read N/A group:__world__ N/A 0 www.howtoreachtheark.now acct:elephant@nomouse.pls N/A id created document group text permissions references uri user 4 2014-10-27T20:40:53.245691+00:00 N/A title __world__ The animals went in two by two, hurrah! hurrah! N/A read N/A group:__world__ N/A 0 www.howtoreachtheark.now acct:elephant@nomouse.pls N/A id user 5 acct:amrit@example.org N/A id permissions references user 6 N/A read N/A acct:jane@example.com N/A 5 acct:jane@example.com N/A id document group permissions references user 7 N/A title wibble N/A read N/A acct:jane@example.com group:wibble N/A 5 acct:jane@example.com _fake_request N/A N/A N/A N/A N/A mock_dumps N/A Mock return_value TOKEN N/A request N/A DummyRequest N/A N/A request domain www.howtoreachtheark.now N/A N/A N/A request registry notification_serializer N/A Mock dumps mock_dumps N/A N/A request route_url N/A Mock N/A N/A N/A request route_url return_value UNSUBSCRIBE_URL N/A request N/A _fake_anno N/A N/A id N/A N/A N/A N/A N/A offset N/A int id N/A N/A N/A TypeError N/A N/A None N/A N/A N/A storage annotation_from_dict N/A store_fake_data N/A offset N/A MockSubscription N/A Mock N/A __json__ N/A N/A self request N/A N/A N/A N/A id uri N/A N/A self id N/A N/A self uri N/A N/A test_dont_send_to_the_same_user N/A N/A N/A N/A N/A Tests that if the parent user and the annotation user is the same
    then this function returns False N/A annotation N/A _fake_anno 3 N/A data N/A parent subscription N/A _fake_anno 0 N/A id 1 N/A send N/A N/A rt check_conditions annotation data N/A N/A send False N/A test_different_subscription N/A N/A N/A N/A N/A If subscription.uri is different from user, do not send! N/A annotation N/A _fake_anno 1 N/A data N/A parent subscription N/A _fake_anno 0 N/A id uri 1 acct:hippopotamus@stucked.sos N/A send N/A N/A rt check_conditions annotation data N/A N/A send False N/A test_good_conditions N/A N/A N/A N/A N/A If conditions match, this function returns with a True value N/A annotation N/A _fake_anno 1 N/A data N/A parent subscription N/A _fake_anno 0 N/A id uri 1 acct:elephant@nomouse.pls N/A send N/A N/A rt check_conditions annotation data N/A N/A send True N/A N/A generate_notifications_fixtures N/A N/A N/A pytest mark usefixtures auth get_user test_generate_notifications_empty_if_action_not_create N/A N/A N/A N/A N/A If the action is not 'create', no notifications should be generated. N/A annotation N/A N/A storage annotation_from_dict N/A N/A request N/A DummyRequest N/A notifications N/A N/A rt generate_notifications request annotation update N/A N/A N/A list notifications N/A N/A generate_notifications_fixtures test_generate_notifications_empty_if_annotation_has_no_parent N/A N/A N/A N/A N/A If the annotation has no parent no notifications should be generated. N/A annotation N/A _fake_anno 0 N/A request N/A DummyRequest N/A notifications N/A N/A rt generate_notifications request annotation create N/A N/A N/A list notifications N/A N/A generate_notifications_fixtures test_generate_notifications_does_not_fetch_if_annotation_has_no_parent N/A N/A fetch N/A N/A N/A Don't try and fetch None if the annotation has no parent N/A annotation N/A _fake_anno 0 N/A request N/A DummyRequest N/A notifications N/A N/A rt generate_notifications request annotation create N/A N/A list notifications N/A N/A N/A fetch assert_not_called N/A generate_notifications_fixtures test_generate_notifications_only_if_author_can_read_reply N/A N/A Subscriptions auth N/A N/A N/A 
    If the annotation is not readable by the parent author, no notifications
    should be generated.
     N/A N/A N/A Subscriptions get_active_subscriptions_for_a_type return_value N/A N/A MockSubscription id 1 uri acct:amrit@example.org N/A N/A N/A auth has_permission return_value False N/A notifications N/A N/A rt generate_notifications N/A _fake_request N/A _fake_anno 6 create N/A N/A N/A list notifications N/A N/A N/A N/A auth has_permission return_value True N/A notifications N/A N/A rt generate_notifications N/A _fake_request N/A _fake_anno 7 create N/A N/A N/A list notifications N/A N/A generate_notifications_fixtures N/A patch h.notification.reply_template.Subscriptions test_generate_notifications_checks_subscriptions N/A N/A Subscriptions N/A N/A N/A If the annotation has a parent, then proceed to check subscriptions. N/A request N/A _fake_request N/A annotation N/A _fake_anno 1 N/A N/A N/A Subscriptions get_active_subscriptions_for_a_type return_value N/A N/A notifications N/A N/A rt generate_notifications request annotation create N/A N/A list notifications N/A N/A N/A N/A Subscriptions get_active_subscriptions_for_a_type assert_called_with reply N/A generate_notifications_fixtures N/A patch h.notification.reply_template.Subscriptions test_check_conditions_false_stops_sending N/A N/A N/A N/A N/A If the check conditions() returns False, no notifications are generated N/A request N/A _fake_request N/A annotation N/A _fake_anno 1 N/A N/A patch h.notification.reply_template.Subscriptions mock_subs N/A N/A N/A N/A mock_subs get_active_subscriptions_for_a_type return_value N/A N/A MockSubscription id 1 uri acct:elephant@nomouse.pls N/A N/A patch h.notification.reply_template.check_conditions mock_conditions N/A N/A N/A mock_conditions return_value False N/A N/A N/A pytest raises StopIteration N/A N/A msgs N/A N/A rt generate_notifications request annotation create N/A N/A N/A msgs next N/A generate_notifications_fixtures test_send_if_everything_is_okay N/A N/A N/A N/A N/A Test whether we generate notifications if every condition is okay N/A request N/A _fake_request N/A annotation N/A _fake_anno 1 N/A N/A patch h.notification.reply_template.Subscriptions mock_subs N/A N/A N/A N/A mock_subs get_active_subscriptions_for_a_type return_value N/A N/A MockSubscription id 1 uri acct:elephant@nomouse.pls N/A N/A patch h.notification.reply_template.check_conditions mock_conditions N/A N/A N/A mock_conditions return_value True N/A msgs N/A N/A rt generate_notifications request annotation create N/A N/A N/A msgs next N/A generate_notifications_fixtures auth N/A N/A patch N/A N/A N/A N/A patch h.notification.reply_template.auth N/A N/A pytest fixture get_user N/A N/A patch N/A N/A N/A N/A patch h.notification.reply_template.accounts.get_user N/A N/A pytest fixture fetch N/A N/A request N/A N/A N/A patcher N/A N/A patch object storage fetch_annotation N/A fetch N/A N/A patcher start N/A N/A fetch side_effect N/A N/A N/A _ id N/A N/A _fake_anno id N/A N/A N/A request addfinalizer N/A patcher stop N/A fetch N/A N/A N/A pytest fixture autouse True