Commit 25f4f921 by Paul Kilgo

add unit tests for Key.__unicode__

parent 62337c53
......@@ -181,6 +181,22 @@ class KeyCreationTestCase(BaseTestCase):
)
self.assertRaises(ValidationError, key.full_clean)
def test_unicode1(self):
'''With fingerprint.'''
key = Key(
key = open(self.key1_path + '.pub').read()
)
key.full_clean()
key.save()
self.assertEqual(key.fingerprint, unicode(key))
def test_unicode2(self):
'''Without fingerprint.'''
contents = open(self.key1_path + '.pub').read()
key = Key(key=contents)
key.save()
self.assertEqual(contents[:20] + '...', unicode(key))
class ApplicationKeyTestCase(BaseTestCase):
@classmethod
def setUpClass(cls):
......@@ -264,7 +280,6 @@ class NamedKeyTestCase(BaseTestCase):
)
self.assertRaises(ValidationError, key.full_clean)
class UserKeyTestCase(BaseTestCase):
@classmethod
def setUpClass(cls):
......
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 sign in to comment