[datafeed] case insensitive etype. Closes #1877014 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 26 Jul 2011 16:50:06 +0200
branchstable
changeset 7701 e5ba5de1d485
parent 7700 0010dde5352a
child 7704 0f49dd8e76b5
[datafeed] case insensitive etype. Closes #1877014
sobjects/parsers.py
sobjects/test/unittest_parsers.py
--- a/sobjects/parsers.py	Tue Jul 26 16:50:02 2011 +0200
+++ b/sobjects/parsers.py	Tue Jul 26 16:50:06 2011 +0200
@@ -247,7 +247,7 @@
             except ValueError:
                 return url + '?' + self._cw.build_url_params(**params)
             try:
-                etype = self._cw.vreg.case_insensitive_etypes[etype]
+                etype = self._cw.vreg.case_insensitive_etypes[etype.lower()]
             except KeyError:
                 return url + '?' + self._cw.build_url_params(**params)
         if add_relations:
--- a/sobjects/test/unittest_parsers.py	Tue Jul 26 16:50:02 2011 +0200
+++ b/sobjects/test/unittest_parsers.py	Tue Jul 26 16:50:06 2011 +0200
@@ -145,6 +145,8 @@
     def test_complete_url(self):
         dfsource = self.repo.sources_by_uri['myfeed']
         parser = dfsource._get_parser(self.session)
+        self.assertEqual(parser.complete_url('http://www.cubicweb.org/CWUser'),
+                         'http://www.cubicweb.org/CWUser?relation=tags-object&relation=in_group-subject&relation=in_state-subject&relation=use_email-subject&vid=xml')
         self.assertEqual(parser.complete_url('http://www.cubicweb.org/cwuser'),
                          'http://www.cubicweb.org/cwuser?relation=tags-object&relation=in_group-subject&relation=in_state-subject&relation=use_email-subject&vid=xml')
         self.assertEqual(parser.complete_url('http://www.cubicweb.org/cwuser?vid=rdf&relation=hop'),