示例#1
0
    def test_load_opml_no_duplicates(self):
        """
        Assert multiple calls to the load_opml creates no duplicates
        """
        self.assertEqual(Feed.objects.count(), 0)
        self.assertEqual(load_opml(FEEDLY), 36)
        self.assertEqual(Feed.objects.count(), 36)

        for _ in range(10):
            self.assertEqual(load_opml(FEEDLY), 0)
            self.assertEqual(Feed.objects.count(), 36)
示例#2
0
    def test_load_opml_no_duplicates(self):
        """
        Assert multiple calls to the load_opml creates no duplicates
        """
        self.assertEqual(Feed.objects.count(), 0)
        self.assertEqual(load_opml(FEEDLY), 36)
        self.assertEqual(Feed.objects.count(), 36)

        for _ in xrange(10):
            self.assertEqual(load_opml(FEEDLY), 0)
            self.assertEqual(Feed.objects.count(), 36)
示例#3
0
    def handle(self, args):
        # Connect to the database
        db.connect()

        # Load the OPML files into the database
        count = sum(load_opml(path) for path in args.opml)
        return "Ingested {} feeds from {} OPML files".format(count, len(args.opml))
示例#4
0
    def handle(self, args):
        # Connect to the database
        db.connect()

        # Load the OPML files into the database
        count = sum(load_opml(path) for path in args.opml)
        return "Ingested {} feeds from {} OPML files".format(count, len(args.opml))
示例#5
0
    def test_load_opml_integrated(self):
        """
        Test the integration of the ingest helper function
        """
        self.assertEqual(Feed.objects.count(), 0)
        self.assertEqual(load_opml(FEEDLY), 36)
        self.assertEqual(Feed.objects.count(), 36)

        for feed in Feed.objects():
            self.assertIn('xmlUrl', feed.urls)
            self.assertIn('htmlUrl', feed.urls)
示例#6
0
    def test_load_opml_integrated(self):
        """
        Test the integration of the ingest helper function
        """
        self.assertEqual(Feed.objects.count(), 0)
        self.assertEqual(load_opml(FEEDLY), 36)
        self.assertEqual(Feed.objects.count(), 36)

        for feed in Feed.objects():
            self.assertIn('xmlUrl', feed.urls)
            self.assertIn('htmlUrl', feed.urls)