changeset 2184:def615934540

use namespace constants in subscriptions tests
author Ana Balica <ana.balica@gmail.com>
date Mon, 09 Sep 2013 14:32:18 +0300
parents aaefa8cfa989
children 36bd132a5a97
files MoinMoin/util/_tests/test_subscriptions.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/_tests/test_subscriptions.py	Sun Sep 08 10:34:07 2013 +0300
+++ b/MoinMoin/util/_tests/test_subscriptions.py	Mon Sep 09 14:32:18 2013 +0300
@@ -11,6 +11,7 @@
 from MoinMoin.items import Item
 from MoinMoin.constants.keys import (ITEMID, CONTENTTYPE, NAME, NAMERE, NAMEPREFIX,
                                      SUBSCRIPTIONS, TAGS)
+from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT, NAMESPACE_USERPROFILES
 from MoinMoin.util.subscriptions import get_subscribers, get_matched_subscription_patterns
 
 
@@ -21,7 +22,7 @@
         # create an item
         self.item_name = u'foo'
         self.tagname = u'XXX'
-        self.namespace = u''
+        self.namespace = NAMESPACE_DEFAULT
         meta = {CONTENTTYPE: u'text/plain;charset=utf-8', TAGS: [self.tagname]}
         item = Item.create(self.item_name)
         item._save(meta)
@@ -71,7 +72,7 @@
         patterns = get_matched_subscription_patterns([], **meta)
         assert patterns == []
         non_matching_patterns = [
-            "{0}:{1}:{2}".format(NAMERE, "userprofile", ".*"),
+            "{0}:{1}:{2}".format(NAMERE, NAMESPACE_USERPROFILES, ".*"),
             "{0}:{1}:{2}".format(NAMERE, self.namespace, "\d+"),
             "{0}:{1}:{2}".format(NAMEPREFIX, self.namespace, "bar"),
         ]