def test_sshkey_display_with_real_life_key(self): # With a real-life ssh-rsa key, the key_string part is cropped. key_string = get_data('data/test_rsa0.pub') user = factory.make_user() key = SSHKey(key=key_string, user=user) display = key.display_html() self.assertEqual( 'ssh-rsa AAAAB3NzaC1yc2E… ubuntu@server-7476', display)
def test_sshkey_display_with_real_life_key(self): # With a real-life ssh-rsa key, the key_string part is cropped. key_string = get_data('data/test_rsa0.pub') user = factory.make_user() key = SSHKey(key=key_string, user=user) display = key.display_html() self.assertEqual( 'ssh-rsa AAAAB3NzaC1yc… ubuntu@test_rsa0.pub', display)
def test_sshkey_display_is_marked_as_HTML_safe(self): key_string = get_data('data/test_rsa0.pub') user = factory.make_user() key = SSHKey(key=key_string, user=user) display = key.display_html() self.assertIsInstance(display, SafeUnicode)