diff options
| author | Barry Warsaw | 2011-08-30 19:11:19 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-08-30 19:11:19 -0400 |
| commit | 0664713d4f7e30b0b56b1ce00ccf3367f416c901 (patch) | |
| tree | 7bc824930335b25aa5e13346992b4754f5ca1e64 /src/mailman/model/tests/test_uid.py | |
| parent | 043562c695387a12e655997abf41cef77cb3d3a4 (diff) | |
| parent | 5a38df15cd6ca0619e0e987624457e0453425dce (diff) | |
| download | mailman-0664713d4f7e30b0b56b1ce00ccf3367f416c901.tar.gz mailman-0664713d4f7e30b0b56b1ce00ccf3367f416c901.tar.zst mailman-0664713d4f7e30b0b56b1ce00ccf3367f416c901.zip | |
* User and Member ids are now proper UUIDs. The UUIDs are pended as unicodes,
and exposed to the REST API as their integer equivalents. They are stored
in the database using Storm's UUID type.
- ISubscriptionService.get_member() now takes a UUID
- IUserManager.get_user_by_id() now takes a UUID
* Moderators and owners can be added via REST (LP: #834130). Given by
Stephen A. Goss.
- add_member() grows a `role` parameter.
- ISubscriptionService.join() grows a `role` parameter.
* InvalidEmailAddressError no longer repr()'s its value.
* `address` -> `email` for consistency
- delete_member()
- ISubscriptionService.leave()
* Fixed typo in app/subscriptions.py __all__
* AlreadySubscribedError: attributes are now public.
* More .txt -> .rst renames.
Diffstat (limited to 'src/mailman/model/tests/test_uid.py')
| -rw-r--r-- | src/mailman/model/tests/test_uid.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mailman/model/tests/test_uid.py b/src/mailman/model/tests/test_uid.py index 6f5cde4d2..c8ba4b770 100644 --- a/src/mailman/model/tests/test_uid.py +++ b/src/mailman/model/tests/test_uid.py @@ -25,6 +25,7 @@ __all__ = [ ] +import uuid import unittest from mailman.model.uid import UID @@ -36,9 +37,16 @@ class TestUID(unittest.TestCase): layer = ConfigLayer def test_record(self): - UID.record('abc') - UID.record('def') - self.assertRaises(ValueError, UID.record, 'abc') + # Test that the .record() method works. + UID.record(uuid.UUID(int=11)) + UID.record(uuid.UUID(int=99)) + self.assertRaises(ValueError, UID.record, uuid.UUID(int=11)) + + def test_longs(self): + # In a non-test environment, the uuid will be a long int. + my_uuid = uuid.uuid4() + UID.record(my_uuid) + self.assertRaises(ValueError, UID.record, my_uuid) |
