Example #1
0
    def test_serves_briefs(self):
        items = briefcast.find_briefs(HERE)

        with app.test_request_context('/'):
            url_root = request.url_root

            rss = briefcast.create_feed(items, url_root)
            briefs_cache = briefcast.get_briefs_cache()

            key = briefs_cache.keys()[0]

            response = self.client.get('/brieflist/%s' % key)

            self.assertEquals(briefs_cache[key]['length'], len(response.data))
    def test_serves_briefs(self):
        items = briefcast.find_briefs(HERE)

        with app.test_request_context('/'):
            url_root = request.url_root

            rss = briefcast.create_feed(items, url_root)
            briefs_cache = briefcast.get_briefs_cache()

            key = briefs_cache.keys()[0]

            response = self.client.get('/brieflist/%s' % key)

            self.assertEquals(briefs_cache[key]['length'], len(response.data))
Example #3
0
    def test_will_provide_rss(self):
        items = briefcast.find_briefs(HERE)

        with app.test_request_context('/'):
            url_root = request.url_root

            rss = briefcast.create_feed(items, url_root)

            expected = env.get_template('example1.rss').render(
                src=realpath(join(HERE, '..', '../')),
                here=HERE,
                pub_date=time.strftime(briefcast.GMT_FORMAT, time.gmtime()),
            )

            self.assertEqual(rss, expected)
    def test_will_provide_rss(self):
        items = briefcast.find_briefs(HERE)

        with app.test_request_context('/'):
            url_root = request.url_root

            rss = briefcast.create_feed(items, url_root)

            expected = env.get_template('example1.rss').render(
                src=realpath(join(HERE, '..', '../')),
                here=HERE,
                pub_date=time.strftime(briefcast.GMT_FORMAT, time.gmtime()),
            )

            self.assertEqual(rss, expected)