# HG changeset patch # User Sylvain Thénault # Date 1276180084 -7200 # Node ID 3c281b6f16c6c87fbfd529b82cf127d77eb9a972 # Parent 0e2af244dea5a8fd7be0ab509ecab63cf473b712 [3.9] fix tests diff -r 0e2af244dea5 -r 3c281b6f16c6 server/test/unittest_querier.py --- a/server/test/unittest_querier.py Thu Jun 10 16:25:15 2010 +0200 +++ b/server/test/unittest_querier.py Thu Jun 10 16:28:04 2010 +0200 @@ -130,7 +130,7 @@ 'X': 'Affaire', 'ET': 'CWEType', 'ETN': 'String'}]) rql, solutions = partrqls[1] - self.assertEquals(rql, 'Any ETN,X WHERE X is ET, ET name ETN, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWUser, Card, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Image, Note, Personne, RQLExpression, Societe, State, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)') + self.assertEquals(rql, 'Any ETN,X WHERE X is ET, ET name ETN, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWUser, Card, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Note, Personne, RQLExpression, Societe, State, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)') self.assertListEquals(sorted(solutions), sorted([{'X': 'BaseTransition', 'ETN': 'String', 'ET': 'CWEType'}, {'X': 'Bookmark', 'ETN': 'String', 'ET': 'CWEType'}, @@ -155,7 +155,6 @@ {'X': 'ExternalUri', 'ETN': 'String', 'ET': 'CWEType'}, {'X': 'File', 'ETN': 'String', 'ET': 'CWEType'}, {'X': 'Folder', 'ETN': 'String', 'ET': 'CWEType'}, - {'X': 'Image', 'ETN': 'String', 'ET': 'CWEType'}, {'X': 'Note', 'ETN': 'String', 'ET': 'CWEType'}, {'X': 'Personne', 'ETN': 'String', 'ET': 'CWEType'}, {'X': 'RQLExpression', 'ETN': 'String', 'ET': 'CWEType'}, diff -r 0e2af244dea5 -r 3c281b6f16c6 server/test/unittest_repository.py --- a/server/test/unittest_repository.py Thu Jun 10 16:25:15 2010 +0200 +++ b/server/test/unittest_repository.py Thu Jun 10 16:28:04 2010 +0200 @@ -16,10 +16,7 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -"""unit tests for module cubicweb.server.repository - -""" -from __future__ import with_statement +"""unit tests for module cubicweb.server.repository""" from __future__ import with_statement @@ -246,8 +243,7 @@ 'constrained_by', 'cardinality', 'ordernum', 'indexed', 'fulltextindexed', 'internationalizable', - 'defaultval', 'description', 'description_format', - 'in_basket']) + 'defaultval', 'description', 'description_format']) self.assertEquals(schema.eschema('CWEType').main_attribute(), 'name') self.assertEquals(schema.eschema('State').main_attribute(), 'name') diff -r 0e2af244dea5 -r 3c281b6f16c6 server/test/unittest_storage.py --- a/server/test/unittest_storage.py Thu Jun 10 16:25:15 2010 +0200 +++ b/server/test/unittest_storage.py Thu Jun 10 16:28:04 2010 +0200 @@ -133,9 +133,15 @@ ' UNION ' '(Any D WHERE X title D, X is Bookmark)') self.assertEquals(str(ex), 'query fetch some source mapped attribute, some not') - ex = self.assertRaises(QueryError, - self.execute, 'Any D WHERE X data D') - self.assertEquals(str(ex), 'query fetch some source mapped attribute, some not') + + storages.set_attribute_storage(self.repo, 'State', 'name', + storages.BytesFileSystemStorage(self.tempdir)) + try: + ex = self.assertRaises(QueryError, + self.execute, 'Any D WHERE X name D, X is IN (State, Transition)') + self.assertEquals(str(ex), 'query fetch some source mapped attribute, some not') + finally: + storages.unset_attribute_storage(self.repo, 'State', 'name') def test_source_mapped_attribute_advanced(self): f1 = self.create_file()