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