reactivate skipped tests due to sqlite bug which is now fixed (sqlite 3.6.13)
# -*- coding: utf-8 -*-fromcubicweb.goa.testlibimport*fromcubicwebimportBinaryfromcubicweb.goa.goaconfigimportGAEConfigurationfromcubicweb.server.utilsimportcrypt_passwordfromgoogle.appengine.api.datastore_typesimportText,BlobclassBlog(db.Model):data=db.BlobProperty()classDBTest(GAEBasedTC):config=GAEConfiguration('toto')config.global_set_option('use-google-auth',False)MODEL_CLASSES=(Blog,)deftest_set_none_relation(self):eprop=self.add_entity('CWProperty',pkey=u'ui.language',value=u'en')self.failUnless('s_for_user'ineprop._dbmodel)self.assertEquals(eprop._dbmodel['s_for_user'],None)deftest_euser_key(self):euser=self.add_entity('CWUser',login=u'toto',upassword='toto')self.assertEquals(euser.key().name(),'key_toto')deftest_egroup_key(self):egroup=self.add_entity('CWGroup',name=u'toto')self.assertEquals(egroup.key().name(),'key_toto')deftest_password_encryption(self):euser=self.add_entity('CWUser',login=u'toto',upassword='toto')self.failUnless(euser.upassword!='toto',euser.upassword)self.assertEquals(crypt_password('toto',euser.upassword[:2]),euser.upassword)deftest_long_text(self):# datastore string type is limited to 500 bytestext=u'e'*501entity=self.add_entity('State',name=u'test',description=text)self.assertIsInstance(entity.description,unicode)self.failIf(isinstance(entity.description,Text))self.assertEquals(entity.description,text)deftest_long_accentued_text(self):# datastore string type is limited to 500 bytestext=u'é'*500entity=self.add_entity('State',name=u'test',description=text)self.assertIsInstance(entity.description,unicode)self.failIf(isinstance(entity.description,Text))self.assertEquals(entity.description,text)deftest_blob(self):data='e'*501entity=self.add_entity('Blog',data=data)self.assertIsInstance(entity.data,Binary)value=entity.data.getvalue()self.failIf(isinstance(value,Blob))self.assertEquals(value,data)if__name__=='__main__':fromlogilab.common.testlibimportunittest_mainunittest_main()