Commit f8d611a2 authored by Tres Seaver's avatar Tres Seaver

Add test for 'txn.user = None'.

Restores 100% coverage.
parent 2bb7d059
......@@ -138,6 +138,8 @@ class Transaction(object):
def user(self, v):
if v is not None:
self._user = text_or_warn(v)
else:
self._user = u""
@property
def description(self):
......
......@@ -1060,6 +1060,12 @@ class TransactionTests(unittest.TestCase):
txn.setUser(u'phreddy', u'/bedrock')
self.assertEqual(txn.user, u'/bedrock phreddy')
def test_user_w_none(self):
txn = self._makeOne()
txn.user = b'phreddy'
txn.user = None # resets to empty text
self.assertEqual(txn.user, u'')
def _test_user_non_text(self, user, path, expect, both=False):
txn = self._makeOne()
with warnings.catch_warnings(record=True) as w:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment