예제 #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)