Esempio n. 1
0
    def returns_date_min_when_no_content_is_available(self):
        LegFile.objects.all().delete()
        updater = ContentFeedRecordUpdater()

        updater.update(self.record, self.library)

        assert_equal(self.record.last_updated, datetime.datetime.min)
Esempio n. 2
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)
Esempio n. 3
0
    def calls_get_last_updated_time_once(self):

        updater = ContentFeedRecordUpdater()

        updater.update_all(self.feed_records, self.library)

        assert_equal(self.feeds[0].get_last_updated_time.call_count, 1)
Esempio n. 4
0
    def returns_date_min_when_no_content_is_available(self):
        LegFile.objects.all().delete()
        updater = ContentFeedRecordUpdater()

        updater.update(self.record, self.library)

        assert_equal(self.record.last_updated, datetime.datetime.min)
Esempio n. 5
0
    def calls_get_last_updated_on_all_feed_objects(self):

        updater = ContentFeedRecordUpdater()

        updater.update_all(self.feed_records, self.library)

        self.feeds[0].get_last_updated.assert_called_with('hello')
        self.feeds[1].get_last_updated.assert_called_with('world')
Esempio n. 6
0
    def changes_the_lastUpdated_of_a_legfiles_feed_to_most_recent_intro_date(self):
        updater = ContentFeedRecordUpdater()

        updater.update(self.record, self.library)

        assert_equal(self.record.last_updated, datetime.date(2011, 8, 17))
Esempio n. 7
0
    def changes_the_lastUpdated_of_a_legfiles_feed_to_most_recent_intro_date(self):
        updater = ContentFeedRecordUpdater()

        updater.update(self.record, self.library)

        assert_equal(self.record.last_updated, datetime.datetime(2011, 8, 17, 0, 0))