def test_notifications(nt): this, other = Record.new(), Record.new() klass = getattr(no, nt) o = klass.new(this, other=other) assert o.good() assert o.id assert list(no.load(this)) no.Notification.delete(this, [o.id]) assert not list(no.load(this))
def test_delete(self, api_authed): other = Record.new() # These types do no require anything other than `other` types = (notifications.FollowerNotification, notifications.FriendNotification) ns = [t.new(api_authed, other=other) for t in types] req = application.delete_json('/api/02/notifications', params={'ids': [str(ns[0].id)]}) assert req.status_int == 200 assert req.json['success'], req.json assert list(notifications.load(api_authed)) req = application.delete_json('/api/02/notifications') assert req.status_int == 200 assert req.json['success'], req.json assert not list(notifications.load(api_authed))