summaryrefslogtreecommitdiff
path: root/src/zope/security/tests/test_management.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2017-09-07 17:52:15 -0500
committerJason Madden <jamadden@gmail.com>2017-09-08 06:29:27 -0500
commit8b01ecd553837b834d2e553e1198d841be380a9c (patch)
tree2d7a9d03f20b34dc38b87a3b414c9fdd8b00c5c4 /src/zope/security/tests/test_management.py
parented4d2b755b0af0d27fcd26211115babe99dbe4ff (diff)
downloadzope-security-8b01ecd553837b834d2e553e1198d841be380a9c.tar.gz
Simplify _compat.py now that we only run on newer Pythons
- We have u'literals' so we don't need a _u() function. For the record the Emacs replacement regex was `_u(\(['"]\)\([^)]*\)\1) -> u\1\2\1`. Amazingly, I typed that right on the first try. A few things were only used in one (test) file or function, so it was better to keep the use, if any, local and out of the "public" api: - We can use io.StringIO everywhere and it's fast. It was only imported in one file anyway. - We can just import pickle. It was only imported in one file anyway. - TEXT was only used in one test function, `type(u'')` is just as clear (especially since the usual name is `text_type`). - reload was only used in one test function, so move the definition there.
Diffstat (limited to 'src/zope/security/tests/test_management.py')
-rw-r--r--src/zope/security/tests/test_management.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/zope/security/tests/test_management.py b/src/zope/security/tests/test_management.py
index 8eee32b..83aca7b 100644
--- a/src/zope/security/tests/test_management.py
+++ b/src/zope/security/tests/test_management.py
@@ -172,17 +172,15 @@ class Test(unittest.TestCase):
def test_system_user(self):
from zope.security.management import system_user
- from zope.security._compat import TEXT
- from zope.security._compat import _u
+
self.assertEqual(system_user.id,
- _u('zope.security.management.system_user'))
+ u'zope.security.management.system_user')
- self.assertEqual(system_user.title, _u('System'))
+ self.assertEqual(system_user.title, u'System')
for name in 'id', 'title', 'description':
- self.assertTrue(isinstance(getattr(system_user, name), TEXT))
+ self.assertIsInstance(getattr(system_user, name),
+ type(u''))
def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(Test),
- ))
+ return unittest.defaultTestLoader.loadTestsFromName(__name__)