def test_valide_translated_string(self): with Stub() as get_lang: from shoplifter.core.db.field import get_lang get_lang() >> 'fr' doc = TranslatedDoc.objects.all()[0] assert_true(isinstance(doc.text, TranslatedString)) assert_equal(doc.text['se'], translated_string['se']) assert_equal(str(doc.text), u"NO TRANSLATION FOUND") with Stub() as get_lang: from shoplifter.core.db.field import get_lang get_lang() >> ['fr', 'gr'] assert_equal(unicode(doc.text), u"NO TRANSLATION FOUND")
def setUp(self): with Stub() as get_lang: from shoplifter.core.db.field import get_lang get_lang() >> [u'en', u'se', u'eg']