Beispiel #1
0
    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')
Beispiel #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')
Beispiel #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')
Beispiel #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)
Beispiel #5
0
 def test_continue_on_404_exception(self):
     _update_mdn_items(test_items)
     eq_(0, MdnCache.objects.count())
Beispiel #6
0
 def test_dont_delete_on_exception(self):
     with self.assertRaises(Exception):
         _update_mdn_items(test_items)
         eq_(2, MdnCache.objects.count())
Beispiel #7
0
 def test_continue_on_404_exception(self):
     _update_mdn_items(test_items)
     eq_(0, MdnCache.objects.count())
Beispiel #8
0
 def test_dont_delete_on_exception(self):
     with self.assertRaises(Exception):
         _update_mdn_items(test_items)
         eq_(2, MdnCache.objects.count())
Beispiel #9
0
 def test_refresh_mdn_cache(self):
     _update_mdn_items(test_items)
     eq_('test',
         MdnCache.objects.get(name=test_items[0]['name'], locale='en').name)