--- 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
--- 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 <http://www.gnu.org/licenses/>.
+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"')
--- 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',