test.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:propublica-congress 作者: eyeseast 项目源码 文件源码
def test_django_cache(self):
        try:
            from django.conf import settings
            settings.configure(CACHE_BACKEND = 'locmem://')
            from django.core.cache import cache
        except ImportError:
            # no Django, so nothing to test
            return

        congress = Congress(API_KEY, cache)

        self.assertEqual(congress.http.cache, cache)
        self.assertEqual(congress.members.http.cache, cache)
        self.assertEqual(congress.bills.http.cache, cache)
        self.assertEqual(congress.votes.http.cache, cache)

        try:
            bills = congress.bills.introduced('house')
        except Exception as e:
            self.fail(e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号