merge
authorSandrine Ribeau <sandrine.ribeau@logilab.fr>
Mon, 10 Nov 2008 13:20:02 -0800
changeset 19 eddd1ad3d08e
parent 18 ebd4db8be177 (current diff)
parent 17 62ce3e6126e0 (diff)
child 20 dfddcbef6684
merge
common/test/data/bootstrap_packages
server/test/data/bootstrap_packages
sobjects/test/data/bootstrap_packages
web/test/data/bootstrap_packages
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/test/data/bootstrap_cubes	Mon Nov 10 13:20:02 2008 -0800
@@ -0,0 +1,1 @@
+file, tag
--- a/common/test/data/bootstrap_packages	Mon Nov 10 13:18:38 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-efile, eclasstags
--- a/devtools/apptest.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/devtools/apptest.py	Mon Nov 10 13:20:02 2008 -0800
@@ -58,7 +58,7 @@
     vcconf = {'cubicweb': self.config.cubicweb_version()}
     self.config.bootstrap_cubes()
     for pk in self.config.cubes():
-        version = self.config.template_version(pk)
+        version = self.config.cube_version(pk)
         vcconf[pk] = version
     self.config._cubes = None
     return vcconf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/test/data/bootstrap_cubes	Mon Nov 10 13:20:02 2008 -0800
@@ -0,0 +1,1 @@
+comment,folder,tag,basket,email,file
--- a/server/test/data/bootstrap_packages	Mon Nov 10 13:18:38 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-ecomment,eclassfolders,eclasstags,ebasket,eemail,efile
--- a/server/test/unittest_repository.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/server/test/unittest_repository.py	Mon Nov 10 13:20:02 2008 -0800
@@ -402,11 +402,10 @@
     def test_versions_inserted(self):
         inserted = [r[0] for r in self.execute('Any K ORDERBY K WHERE P pkey K, P pkey ~= "system.version.%"')]
         self.assertEquals(inserted,
-                          [u'system.version.ebasket', u'system.version.eclassfolders',
-                           u'system.version.eclasstags', u'system.version.ecomment',
-                           u'system.version.eemail', u'system.version.efile',
-                           u'system.version.cubicweb'])
-
+                          [u'system.version.basket', u'system.version.comment', 
+                           u'system.version.cubicweb', u'system.version.email', 
+                           u'system.version.file', u'system.version.folder', 
+                           u'system.version.tag'])
         
 class InlineRelHooksTC(RepositoryBasedTC):
     """test relation hooks are called for inlined relations
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sobjects/test/data/bootstrap_cubes	Mon Nov 10 13:20:02 2008 -0800
@@ -0,0 +1,1 @@
+comment
--- a/sobjects/test/data/bootstrap_packages	Mon Nov 10 13:18:38 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-ecomment
--- a/test/unittest_cwconfig.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/test/unittest_cwconfig.py	Mon Nov 10 13:20:02 2008 -0800
@@ -16,40 +16,40 @@
 class CubicWebConfigurationTC(TestCase):
     def setUp(self):
         self.config = ApptestConfiguration('data')
-        self.config._cubes = ('eemail', 'efile')
+        self.config._cubes = ('email', 'file')
 
     def test_reorder_cubes(self):
-        # jpl depends on eemail and efile and ecomment
-        # eemail depends on efile
-        self.assertEquals(self.config.reorder_cubes(['efile', 'eemail', 'jpl']),
-                          ('jpl', 'eemail', 'efile'))
-        self.assertEquals(self.config.reorder_cubes(['eemail', 'efile', 'jpl']),
-                          ('jpl', 'eemail', 'efile'))
-        self.assertEquals(self.config.reorder_cubes(['eemail', 'jpl', 'efile']),
-                          ('jpl', 'eemail', 'efile'))
-        self.assertEquals(self.config.reorder_cubes(['efile', 'jpl', 'eemail']),
-                          ('jpl', 'eemail', 'efile'))
-        self.assertEquals(self.config.reorder_cubes(['jpl', 'efile', 'eemail']),
-                          ('jpl', 'eemail', 'efile'))
-        self.assertEquals(self.config.reorder_cubes(('jpl', 'eemail', 'efile')),
-                          ('jpl', 'eemail', 'efile'))
+        # jpl depends on email and file and comment
+        # email depends on file
+        self.assertEquals(self.config.reorder_cubes(['file', 'email', 'jpl']),
+                          ('jpl', 'email', 'file'))
+        self.assertEquals(self.config.reorder_cubes(['email', 'file', 'jpl']),
+                          ('jpl', 'email', 'file'))
+        self.assertEquals(self.config.reorder_cubes(['email', 'jpl', 'file']),
+                          ('jpl', 'email', 'file'))
+        self.assertEquals(self.config.reorder_cubes(['file', 'jpl', 'email']),
+                          ('jpl', 'email', 'file'))
+        self.assertEquals(self.config.reorder_cubes(['jpl', 'file', 'email']),
+                          ('jpl', 'email', 'file'))
+        self.assertEquals(self.config.reorder_cubes(('jpl', 'email', 'file')),
+                          ('jpl', 'email', 'file'))
         
     def test_reorder_cubes_recommends(self):
-        from ecomment import __pkginfo__ as ecomment_pkginfo
-        ecomment_pkginfo.__recommend__ = ('efile',)
+        from cubes.comment import __pkginfo__ as comment_pkginfo
+        comment_pkginfo.__recommend__ = ('file',)
         try:
-            # eemail recommends ecomment
-            # ecomment recommends efile
-            self.assertEquals(self.config.reorder_cubes(('jpl', 'eemail', 'efile', 'ecomment')),
-                              ('jpl', 'eemail', 'ecomment', 'efile'))
-            self.assertEquals(self.config.reorder_cubes(('jpl', 'eemail', 'ecomment', 'efile')),
-                              ('jpl', 'eemail', 'ecomment', 'efile'))
-            self.assertEquals(self.config.reorder_cubes(('jpl', 'ecomment', 'eemail', 'efile')),
-                              ('jpl', 'eemail', 'ecomment', 'efile'))
-            self.assertEquals(self.config.reorder_cubes(('ecomment', 'jpl', 'eemail', 'efile')),
-                              ('jpl', 'eemail', 'ecomment', 'efile'))
+            # email recommends comment
+            # comment recommends file
+            self.assertEquals(self.config.reorder_cubes(('jpl', 'email', 'file', 'comment')),
+                              ('jpl', 'email', 'comment', 'file'))
+            self.assertEquals(self.config.reorder_cubes(('jpl', 'email', 'comment', 'file')),
+                              ('jpl', 'email', 'comment', 'file'))
+            self.assertEquals(self.config.reorder_cubes(('jpl', 'comment', 'email', 'file')),
+                              ('jpl', 'email', 'comment', 'file'))
+            self.assertEquals(self.config.reorder_cubes(('comment', 'jpl', 'email', 'file')),
+                              ('jpl', 'email', 'comment', 'file'))
         finally:
-            ecomment_pkginfo.__use__ = ()
+            comment_pkginfo.__use__ = ()
             
         
 #     def test_vc_config(self):
@@ -61,14 +61,14 @@
 #         self.assertRaises(KeyError, vcconf.__getitem__, 'CRM')
         
     def test_expand_cubes(self):
-        self.assertEquals(self.config.expand_cubes(('eemail', 'eblog')),
-                          ['eemail', 'eblog', 'efile'])
+        self.assertEquals(self.config.expand_cubes(('email', 'eblog')),
+                          ['email', 'eblog', 'file'])
 
     def test_vregistry_path(self):
         self.assertEquals([unabsolutize(p) for p in self.config.vregistry_path()],
                           ['entities', 'web/views', 'sobjects',
-                           'efile/entities.py', 'efile/views', 'efile/hooks.py',
-                           'eemail/entities.py', 'eemail/views', 'eemail/hooks.py'])
+                           'file/entities.py', 'file/views', 'file/hooks.py',
+                           'email/entities.py', 'email/views', 'email/hooks.py'])
             
 if __name__ == '__main__':
     unittest_main()
--- a/test/unittest_schema.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/test/unittest_schema.py	Mon Nov 10 13:20:02 2008 -0800
@@ -142,7 +142,7 @@
         entities.sort()
         expected_entities = ['Bookmark', 'Boolean', 'Bytes', 'Card', 
                              'Date', 'Datetime', 'Decimal',
-                             'EConstraint', 'EConstraintType', 'EEType',
+                             'ECache', 'EConstraint', 'EConstraintType', 'EEType',
                              'EFRDef', 'EGroup', 'EmailAddress', 'ENFRDef',
                              'EPermission', 'EProperty', 'ERType', 'EUser',
                              'Float', 'Int', 'Interval', 
@@ -186,7 +186,7 @@
                               
                               'specializes', 'state_of', 'surname', 'symetric', 'synopsis',
 
-                              'title', 'to_entity', 'to_state', 'transition_of',
+                              'timestamp', 'title', 'to_entity', 'to_state', 'transition_of',
 
                               'upassword', 'update_permission', 'use_email',
 
--- a/web/data/cubicweb.ajax.js	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/data/cubicweb.ajax.js	Mon Nov 10 13:20:02 2008 -0800
@@ -222,7 +222,6 @@
     rql = rql || '';
     nodeid = nodeid || (compid + 'Component');
     extraargs = extraargs || {};
-  log('extraargs =', extraargs);
     var node = getNode(nodeid);
     var d = async_rawremote_exec('component', compid, rql, registry, extraargs);
     d.addCallback(function(result, req) {
--- a/web/data/cubicweb.compat.js	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/data/cubicweb.compat.js	Mon Nov 10 13:20:02 2008 -0800
@@ -49,14 +49,14 @@
     jQuery(node).removeClass(klass);
 }
 
-hasElementClass = jQuery.className.has
+hasElementClass = jQuery.className.has;
 
 
 function partial(func) {
     var args = sliceList(arguments, 1);
     return function() {
 	return func.apply(null, merge(args, arguments));
-    }
+    };
 }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/test/data/bootstrap_cubes	Mon Nov 10 13:20:02 2008 -0800
@@ -0,0 +1,1 @@
+file, blog, tag
--- a/web/test/data/bootstrap_packages	Mon Nov 10 13:18:38 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-efile, eblog, eclasstags
--- a/web/test/unittest_views_baseforms.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/test/unittest_views_baseforms.py	Mon Nov 10 13:20:02 2008 -0800
@@ -203,7 +203,7 @@
 
 
     def test_nonregr_check_add_permission_on_relation(self):
-        from eblog.entities import BlogEntry
+        from cubes.blog.entities import BlogEntry
         class BlogEntryPlus(BlogEntry):
             __rtags__ = {'checked_by': 'primary'}
         self.vreg.register_vobject_class(BlogEntryPlus)
--- a/web/test/unittest_views_navigation.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/test/unittest_views_navigation.py	Mon Nov 10 13:20:02 2008 -0800
@@ -5,7 +5,7 @@
 
 from cubicweb.web.views.navigation import PageNavigation, SortedNavigation
 
-from eclasstags.views import TagsBarVComponent
+from cubes.tag.views import TagsBarVComponent
 TagsBarVComponent.visible = True
 
 class NavigationTC(EnvBasedTC):
@@ -26,7 +26,7 @@
         navcomp = self.vreg.select_component('navigation', req, rset)
         self.assertIsInstance(navcomp, SortedNavigation)
         req.set_search_state('normal')
-        rset = self.execute('Any X,N WHERE X name N LIMIT 10')
+        rset = self.execute('Any X,N LIMIT 10 WHERE X name N')
         navcomp = self.vreg.select_component('navigation', req, rset)
         self.assertEquals(navcomp, None)
         req.set_search_state('W:X:Y:Z')
@@ -75,13 +75,13 @@
                                            view=view, context='navtop')
         # tagbar should be in headers by default
         clsids = set(obj.id for obj in objs)
-        self.failUnless('tagsbar' in clsids)
+        self.failUnless('tagbar' in clsids)
         objs = self.vreg.possible_vobjects('contentnavigation', req, rset,
                                           view=view, context='navbottom')
         # tagbar should _NOT_ be in footers by default
         clsids = set(obj.id for obj in objs)
-        self.failIf('tagsbar' in clsids)
-        self.execute('INSERT EProperty P: P pkey "contentnavigation.tagsbar.context", '
+        self.failIf('tagbar' in clsids)
+        self.execute('INSERT EProperty P: P pkey "contentnavigation.tagbar.context", '
                      'P value "navbottom"')
         # tagbar should now be in footers
         req.cnx.commit()
@@ -89,12 +89,12 @@
                                           view=view, context='navbottom')
         
         clsids = [obj.id for obj in objs]
-        self.failUnless('tagsbar' in clsids)
+        self.failUnless('tagbar' in clsids)
         objs = self.vreg.possible_vobjects('contentnavigation', req, rset,
                                           view=view, context='navtop')
         
         clsids = [obj.id for obj in objs]
-        self.failIf('tagsbar' in clsids)
+        self.failIf('tagbar' in clsids)
         
 
 if __name__ == '__main__':
--- a/web/test/unittest_views_searchrestriction.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/test/unittest_views_searchrestriction.py	Mon Nov 10 13:20:02 2008 -0800
@@ -1,8 +1,9 @@
 from cubicweb.devtools.apptest import EnvBasedTC
-from cubicweb.web.views.searchrestriction import extract_filter_fields, insert_attr_select_relation
+from cubicweb.web.views.searchrestriction import insert_attr_select_relation
 
 class ExtractFilterFieldsTC(EnvBasedTC):
     def test_relations_cleanup(self):
+        self.skip('test needs to be updated (facet API changed)')
         # removing relation should be done in the table filter form but not
         # from the facets box
         rset = self.execute('Any X, S WHERE X in_state S')
@@ -23,6 +24,9 @@
 
 
 class InsertAttrRelationTC(EnvBasedTC):
+    def setUp(self):
+        self.skip('test needs to be updated (facet API changed)')
+
     def parse(self, query):
         rqlst = self.vreg.parse(self.session, query)
         select = rqlst.children[0]
@@ -30,7 +34,7 @@
         return select
 
     def _generate(self, select, rel, var, attr):
-        return insert_attr_select_relation(select, select.defined_vars[var], rel, attr)
+        return insert_attr_select_relation(select, select.defined_vars[var], 'subject', rel, attr)
         
     @property
     def select(self):
--- a/web/test/unittest_webconfig.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/test/unittest_webconfig.py	Mon Nov 10 13:20:02 2008 -0800
@@ -8,7 +8,7 @@
 class WebconfigTC(TestCase):
     def setUp(self):
         self.config = ApptestConfiguration('data')
-        self.config._cubes = ['efile']
+        self.config._cubes = ['file']
         self.config.load_configuration()
         
     def test_nonregr_print_css_as_list(self):
@@ -23,7 +23,7 @@
     def test_locate_resource(self):
         self.failUnless('FILE_ICON' in self.config.ext_resources)
         rname = self.config.ext_resources['FILE_ICON'].replace('DATADIR/', '')
-        self.failUnless('efile' in self.config.locate_resource(rname).split(os.sep))
+        self.failUnless('file' in self.config.locate_resource(rname).split(os.sep))
         cubicwebcsspath = self.config.locate_resource('cubicweb.css').split(os.sep)
         self.failUnless('web' in cubicwebcsspath or 'shared' in cubicwebcsspath) # 'shared' if tests under apycot
         
--- a/web/views/basetemplates.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/views/basetemplates.py	Mon Nov 10 13:20:02 2008 -0800
@@ -163,7 +163,7 @@
                                                  self.req, self.rset)
         if etypefilter and etypefilter.propval('visible'):
             etypefilter.dispatch(w=self.w)
-        self.pagination(self.req, self.rset, self.w, not view.need_navigation)
+        self.pagination(self.req, self.rset, self.w, not (view and view.need_navigation))
         self.w(u'<div id="contentmain">\n')
     
     def template_html_header(self, content_type, page_title, additional_headers=()):
--- a/web/views/facets.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/views/facets.py	Mon Nov 10 13:20:02 2008 -0800
@@ -48,13 +48,13 @@
         else:
             rset = self.rset
             vid, divid = None, 'pageContent'
-            paginate = view.need_navigation
+            paginate = view and view.need_navigation
         return rset, vid, divid, paginate
         
     def call(self, view=None):
         req = self.req
         req.add_js( ('cubicweb.ajax.js', 'cubicweb.formfilter.js') )
-        rset, vid, divid, paginate = self._get_context(view)
+        rset, vid, divid, paginate=self._get_context(view)
         if rset.rowcount < 2: # XXX done by selectors, though maybe necessary when rset has been hijacked
             return
         if vid is None:
--- a/web/views/searchrestriction.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/views/searchrestriction.py	Mon Nov 10 13:20:02 2008 -0800
@@ -2,31 +2,6 @@
 a search
 
 :organization: Logilab
-:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
-:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
-"""
-__docformat__ = "restructuredtext en"
-
-from simplejson import dumps
-
-from logilab.common.graph import has_path
-from logilab.common.decorators import cached
-from logilab.common.compat import all
-
-from logilab.mtconverter import html_escape
-
-from rql import nodes
-
-
-
-from cubicweb.web.facet import (VocabularyFacet, prepare_facets_rqlst)
-
-
-"""Set of base controllers, which are directly plugged into the application
-object to handle publication.
-
-
-:organization: Logilab
 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
--- a/web/views/tableview.py	Mon Nov 10 13:18:38 2008 -0800
+++ b/web/views/tableview.py	Mon Nov 10 13:20:02 2008 -0800
@@ -41,7 +41,6 @@
         self.w(u'<tr>\n')
         for facet in facets:
             wdg = facet.get_widget()
-            print 'FACT WIDGET', wdg
             if wdg is not None:
                 self.w(u'<td>')
                 wdg.render(w=self.w)
@@ -118,7 +117,7 @@
             if title:
                 self.w(u'<h2 class="tableTitle">%s</h2>\n' % title)
             if displayfilter:
-                rqslt.save_state()
+                rqlst.save_state()
                 try:
                     mainvar, baserql = prepare_facets_rqlst(rqlst, rset.args)
                 except NotImplementedError: