Commit 0617f190 by Scott Duckworth

add more tests

parent ebe6c90b
...@@ -105,6 +105,23 @@ class UserKeyCreationTestCase(BaseTestCase): ...@@ -105,6 +105,23 @@ class UserKeyCreationTestCase(BaseTestCase):
) )
self.assertRaises(ValidationError, key.full_clean) self.assertRaises(ValidationError, key.full_clean)
def test_key_with_options_fails(self):
key = UserKey(
user = self.user1,
name = 'name',
key = 'command="foobar" ' + open(self.key1_path+'.pub').read(),
)
self.assertRaises(ValidationError, key.full_clean)
def test_multiple_keys_fails(self):
key = UserKey(
user = self.user1,
name = 'name',
key = open(self.key1_path+'.pub').read() \
+ open(self.key2_path+'.pub').read(),
)
self.assertRaises(ValidationError, key.full_clean)
def test_fingerprint(self): def test_fingerprint(self):
fingerprint = ssh_fingerprint(self.key1_path+'.pub') fingerprint = ssh_fingerprint(self.key1_path+'.pub')
key = UserKey( key = UserKey(
......
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