changeset 2229:63bc1dd3d321

Now we use ':' instead of '/'. Fixes #2, #3, #7.
author Ashutosh Singla <ashu1461@gmail.com>
date Mon, 29 Jul 2013 11:35:07 +0530
parents c992a1dda217
children f2bd327932fb
files MoinMoin/storage/__init__.py MoinMoin/storage/middleware/_tests/test_indexing.py
diffstat 2 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/__init__.py	Mon Jul 22 22:51:34 2013 +0530
+++ b/MoinMoin/storage/__init__.py	Mon Jul 29 11:35:07 2013 +0530
@@ -85,14 +85,14 @@
         userprofiles_acl = dict(before=u'All:', default=u'', after=u'', hierarchic=False)
     namespaces = {
         NAMESPACE_DEFAULT: BACKEND_DEFAULT,
-        NAMESPACE_USERPROFILES + ':': BACKEND_USERPROFILES,
+        NAMESPACE_USERPROFILES + '/': BACKEND_USERPROFILES,
     }
     backends = {
         BACKEND_DEFAULT: None,
         BACKEND_USERPROFILES: None,
     }
     acls = {
-        NAMESPACE_USERPROFILES + ':': userprofiles_acl,
+        NAMESPACE_USERPROFILES + '/': userprofiles_acl,
         NAMESPACE_DEFAULT: default_acl,
     }
     return create_mapping(uri, namespaces, backends, acls)
--- a/MoinMoin/storage/middleware/_tests/test_indexing.py	Mon Jul 22 22:51:34 2013 +0530
+++ b/MoinMoin/storage/middleware/_tests/test_indexing.py	Mon Jul 29 11:35:07 2013 +0530
@@ -19,6 +19,8 @@
                                      LATEST_REVS, ALL_REVS, NAMESPACE)
 from MoinMoin.constants.namespaces import NAMESPACE_USERPROFILES
 
+from MoinMoin.util.interwiki import split_fqname
+
 from MoinMoin.auth import GivenAuth
 from MoinMoin._tests import wikiconfig
 
@@ -372,9 +374,10 @@
         item = self.imw[item_name_n]
         rev_n = item.store_revision(dict(name=[item_name_n, ], contenttype=u'text/plain;charset=utf-8'),
                                     StringIO(str(item_name_n)), return_rev=True)
-        item_name_u = u'%s:userprofile' % NAMESPACE_USERPROFILES
-        item = self.imw[item_name_u]
-        rev_u = item.store_revision(dict(name=[item_name_u, ], contenttype=u'text/plain;charset=utf-8'),
+        item_name_u = u'%s/userprofile' % NAMESPACE_USERPROFILES
+        fqname_u = split_fqname(item_name_u)
+        item = self.imw.get_item(**fqname_u.query)
+        rev_u = item.store_revision(dict(name=[fqname_u.value,], namespace=fqname_u.namespace, contenttype=u'text/plain;charset=utf-8'),
                                     StringIO(str(item_name_u)), return_rev=True)
         item = self.imw[item_name_n]
         rev_n = item.get_revision(rev_n.revid)
@@ -383,7 +386,7 @@
         item = self.imw[item_name_u]
         rev_u = item.get_revision(rev_u.revid)
         assert rev_u.meta[NAMESPACE] == NAMESPACE_USERPROFILES
-        assert rev_u.meta[NAME] == [item_name_u.split(':')[1]]
+        assert rev_u.meta[NAME] == [item_name_u.split('/')[1]]
 
     def test_parentnames(self):
         item_name = u'child'