示例#1
0
文件: test_tasks.py 项目: vdt/zamboni
    def test_refresh_mdn_cache_with_old_data(self):
        eq_('old', MdnCache.objects.get(name='old', locale='en').name)
        _update_mdn_items(test_items)
        eq_('test',
            MdnCache.objects.get(name=test_items[0]['name'], locale='en').name)
        eq_(1, MdnCache.objects.count())

        with self.assertRaises(MdnCache.DoesNotExist):
            MdnCache.objects.get(name='old', locale='en')
示例#2
0
    def test_refresh_mdn_cache_with_old_data(self):
        eq_('old', MdnCache.objects.get(name='old',
                                        locale='en-US').name)
        _update_mdn_items(test_items)
        eq_('test', MdnCache.objects.get(name=test_items[0]['name'],
                                         locale='en-US').name)
        eq_(1, MdnCache.objects.count())

        with self.assertRaises(MdnCache.DoesNotExist):
            MdnCache.objects.get(name='old', locale='en-US')
示例#3
0
    def test_refresh_mdn_cache_with_old_data(self):
        eq_('old', MdnCache.objects.get(name='old',
                                        locale='en-US').name)
        _update_mdn_items(test_items)
        eq_('test', MdnCache.objects.get(name=test_items[0]['name'],
                                         locale='en-US').name)
        self.assertSetEqual(list(MdnCache.objects.values_list('locale', flat=True)), locales)

        with self.assertRaises(MdnCache.DoesNotExist):
            MdnCache.objects.get(name='old', locale='en-US')
示例#4
0
 def test_refresh_mdn_cache(self):
     _update_mdn_items(test_items)
     eq_('test', MdnCache.objects.get(name=test_items[0]['name'],
                                      locale='en-US').name)
示例#5
0
 def test_continue_on_404_exception(self):
     _update_mdn_items(test_items)
     eq_(0, MdnCache.objects.count())
示例#6
0
 def test_dont_delete_on_exception(self):
     with self.assertRaises(Exception):
         _update_mdn_items(test_items)
         eq_(2, MdnCache.objects.count())
示例#7
0
文件: test_tasks.py 项目: vdt/zamboni
 def test_continue_on_404_exception(self):
     _update_mdn_items(test_items)
     eq_(0, MdnCache.objects.count())
示例#8
0
文件: test_tasks.py 项目: vdt/zamboni
 def test_dont_delete_on_exception(self):
     with self.assertRaises(Exception):
         _update_mdn_items(test_items)
         eq_(2, MdnCache.objects.count())
示例#9
0
文件: test_tasks.py 项目: vdt/zamboni
 def test_refresh_mdn_cache(self):
     _update_mdn_items(test_items)
     eq_('test',
         MdnCache.objects.get(name=test_items[0]['name'], locale='en').name)