# HG changeset patch # User Sylvain Thénault # Date 1318593046 -7200 # Node ID 5da7ede690630fea7c024a0908c25c6bfe69d5e4 # Parent 48330faf4cd721133b61ac7479317546edb3804a [test] fix some failures recently introduced diff -r 48330faf4cd7 -r 5da7ede69063 sobjects/parsers.py --- a/sobjects/parsers.py Fri Oct 14 09:04:39 2011 +0200 +++ b/sobjects/parsers.py Fri Oct 14 13:50:46 2011 +0200 @@ -61,9 +61,14 @@ ustr = ustr.split('.',1)[0] return datetime.strptime(ustr, '%Y-%m-%d %H:%M:%S') DEFAULT_CONVERTERS['Datetime'] = convert_datetime +# XXX handle timezone, though this will be enough as TZDatetime are +# serialized without time zone by default (UTC time). See +# cw.web.views.xmlrss.SERIALIZERS. +DEFAULT_CONVERTERS['TZDatetime'] = convert_datetime def convert_time(ustr): return totime(datetime.strptime(ustr, '%H:%M:%S')) DEFAULT_CONVERTERS['Time'] = convert_time +DEFAULT_CONVERTERS['TZTime'] = convert_time def convert_interval(ustr): return time(seconds=int(ustr)) DEFAULT_CONVERTERS['Interval'] = convert_interval diff -r 48330faf4cd7 -r 5da7ede69063 sobjects/test/unittest_parsers.py --- a/sobjects/test/unittest_parsers.py Fri Oct 14 09:04:39 2011 +0200 +++ b/sobjects/test/unittest_parsers.py Fri Oct 14 13:50:46 2011 +0200 @@ -16,6 +16,8 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . +from __future__ import with_statement + from datetime import datetime from cubicweb.devtools.testlib import CubicWebTC @@ -228,13 +230,15 @@ ('unknown', 'http://testing.fr/cubicweb/', 'system'))) ) session.set_cnxset() - stats = dfsource.pull_data(session, force=True, raise_on_error=True) + with session.security_enabled(read=False): # avoid Unauthorized due to password selection + stats = dfsource.pull_data(session, force=True, raise_on_error=True) self.assertEqual(stats['created'], set()) self.assertEqual(len(stats['updated']), 2) self.repo._type_source_cache.clear() self.repo._extid_cache.clear() session.set_cnxset() - stats = dfsource.pull_data(session, force=True, raise_on_error=True) + with session.security_enabled(read=False): # avoid Unauthorized due to password selection + stats = dfsource.pull_data(session, force=True, raise_on_error=True) self.assertEqual(stats['created'], set()) self.assertEqual(len(stats['updated']), 2) session.commit() @@ -255,7 +259,8 @@ self.commit() # test everything is still fine after source synchronization session.set_cnxset() - stats = dfsource.pull_data(session, force=True, raise_on_error=True) + with session.security_enabled(read=False): # avoid Unauthorized due to password selection + stats = dfsource.pull_data(session, force=True, raise_on_error=True) rset = self.sexecute('EmailAddress X WHERE X address "syt@logilab.fr"') self.assertEqual(len(rset), 1) e = rset.get_entity(0, 0) @@ -273,7 +278,8 @@ self.commit() # test everything is still fine after source synchronization session.set_cnxset() - stats = dfsource.pull_data(session, force=True, raise_on_error=True) + with session.security_enabled(read=False): # avoid Unauthorized due to password selection + stats = dfsource.pull_data(session, force=True, raise_on_error=True) rset = self.sexecute('EmailAddress X WHERE X address "syt@logilab.fr"') self.assertEqual(len(rset), 0) rset = self.sexecute('Any X WHERE X use_email E, X login "sthenault"') diff -r 48330faf4cd7 -r 5da7ede69063 test/unittest_schema.py --- a/test/unittest_schema.py Fri Oct 14 09:04:39 2011 +0200 +++ b/test/unittest_schema.py Fri Oct 14 13:50:46 2011 +0200 @@ -194,7 +194,7 @@ 'from_entity', 'from_state', 'fulltext_container', 'fulltextindexed', 'has_text', - 'identity', 'in_group', 'in_state', 'indexed', + 'identity', 'in_group', 'in_state', 'in_synchronization', 'indexed', 'initial_state', 'inlined', 'internationalizable', 'is', 'is_instance_of', 'label', 'last_login_time', 'latest_retrieval', 'lieu', 'login', @@ -209,7 +209,7 @@ 'read_permission', 'relation_type', 'relations', 'require_group', - 'specializes', 'state_of', 'subworkflow', 'subworkflow_exit', 'subworkflow_state', 'surname', 'symmetric', 'synchronizing', 'synopsis', + 'specializes', 'state_of', 'subworkflow', 'subworkflow_exit', 'subworkflow_state', 'surname', 'symmetric', 'synopsis', 'tags', 'timestamp', 'title', 'to_entity', 'to_state', 'transition_of', 'travaille', 'type',