Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-sshkey
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
25f4f921
authored
Oct 09, 2014
by
Paul Kilgo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unit tests for Key.__unicode__
parent
62337c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
django_sshkey/tests.py
+16
-1
No files found.
django_sshkey/tests.py
View file @
25f4f921
...
@@ -181,6 +181,22 @@ class KeyCreationTestCase(BaseTestCase):
...
@@ -181,6 +181,22 @@ class KeyCreationTestCase(BaseTestCase):
)
)
self
.
assertRaises
(
ValidationError
,
key
.
full_clean
)
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
):
class
ApplicationKeyTestCase
(
BaseTestCase
):
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
...
@@ -264,7 +280,6 @@ class NamedKeyTestCase(BaseTestCase):
...
@@ -264,7 +280,6 @@ class NamedKeyTestCase(BaseTestCase):
)
)
self
.
assertRaises
(
ValidationError
,
key
.
full_clean
)
self
.
assertRaises
(
ValidationError
,
key
.
full_clean
)
class
UserKeyTestCase
(
BaseTestCase
):
class
UserKeyTestCase
(
BaseTestCase
):
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment