diff options
| author | Barry Warsaw | 2015-12-29 17:56:10 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2015-12-29 17:56:10 -0500 |
| commit | 8e69b848270da6ba4852f8c6dfdeeed8124ab024 (patch) | |
| tree | ee1d95464be55662ef7ea3b6a8c08ea7218214fc /src/mailman/model | |
| parent | 1602cecded07961585838a31758147e76584e957 (diff) | |
| download | mailman-8e69b848270da6ba4852f8c6dfdeeed8124ab024.tar.gz mailman-8e69b848270da6ba4852f8c6dfdeeed8124ab024.tar.zst mailman-8e69b848270da6ba4852f8c6dfdeeed8124ab024.zip | |
More coverage.
Diffstat (limited to 'src/mailman/model')
| -rw-r--r-- | src/mailman/model/tests/test_uid.py | 6 | ||||
| -rw-r--r-- | src/mailman/model/tests/test_workflow.py | 4 | ||||
| -rw-r--r-- | src/mailman/model/uid.py | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/mailman/model/tests/test_uid.py b/src/mailman/model/tests/test_uid.py index 8f3b4af70..67fdab71e 100644 --- a/src/mailman/model/tests/test_uid.py +++ b/src/mailman/model/tests/test_uid.py @@ -85,3 +85,9 @@ class TestUID(unittest.TestCase): # And all the users still exist. non_orphans = set(user.user_id for user in manager.users) self.assertEqual(uids, non_orphans) + + def test_repr(self): + uid = UID(uuid.UUID(int=1)) + self.assertTrue(repr(uid).startswith( + '<UID 00000000-0000-0000-0000-000000000001 at ')) + self.assertTrue(repr(uid).endswith('>')) diff --git a/src/mailman/model/tests/test_workflow.py b/src/mailman/model/tests/test_workflow.py index 88ed506bd..986bcc3bf 100644 --- a/src/mailman/model/tests/test_workflow.py +++ b/src/mailman/model/tests/test_workflow.py @@ -146,3 +146,7 @@ class TestWorkflow(unittest.TestCase): self.assertEqual(state.step, 'three') state = self._manager.restore('bee', 'nekot') self.assertEqual(state.step, 'four') + + def test_discard_missing_workflow(self): + self._manager.discard('bogus-name', 'bogus-token') + self.assertEqual(self._manager.count, 0) diff --git a/src/mailman/model/uid.py b/src/mailman/model/uid.py index 40d137ee0..750f092cc 100644 --- a/src/mailman/model/uid.py +++ b/src/mailman/model/uid.py @@ -50,12 +50,12 @@ class UID(Model): @dbconnection def __init__(self, store, uid): - super(UID, self).__init__() + super().__init__() self.uid = uid store.add(self) def __repr__(self): - return '<UID {0} at {1}>'.format(self.uid, id(self)) + return '<UID {} at {}>'.format(self.uid, id(self)) @staticmethod @dbconnection |
