Esempio n. 1
0
    def handle(self, *args, **options):
        # Make sure that the library knows about all the types of feeds.
        import_all_feeds()

        records = self.get_records()
        updater = ContentFeedRecordUpdater()
        updater.update_all(records)
    def handle(self, *args, **options):
        # Assuming that the feeds have been updated

        import_all_feeds()
        dispatcher = SubscriptionEmailer()

        subscribers = Subscriber.objects.all()
        for subscriber in subscribers:
            dispatcher.dispatch_subscriptions_for(subscriber)
    def handle(self, *args, **options):
        # Assuming that the feeds have been updated

        import_all_feeds()
        dispatcher = SubscriptionEmailer()

        subscribers = Subscriber.objects.all()
        for subscriber in subscribers:
            dispatcher.dispatch_subscriptions_for(subscriber)
    def setup (self):
        Subscriber.objects.all().delete()
        Subscription.objects.all().delete()
        ContentFeedRecord.objects.all().delete()

        import_all_feeds()

        subscriber = Subscriber.objects.create(email='*****@*****.**')
        updater = ContentFeedRecordUpdater()
        dispatcher = SubscriptionDispatcher()
        dispatcher.deliver_to = Mock()
        dispatcher.render = Mock()

        self.subscriber = Mock(wraps=subscriber)
        self.updater = Mock(wraps=updater)
        self.dispatcher = Mock(wraps=dispatcher)