Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
19ac076c
Commit
19ac076c
authored
May 07, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test command for users import
parent
fabd580d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
accounts/tests.py
accounts/tests.py
+13
-0
trans/tests/data/users.json
trans/tests/data/users.json
+1
-0
No files found.
accounts/tests.py
View file @
19ac076c
...
...
@@ -39,6 +39,7 @@ from accounts.models import (
)
from
trans.tests.views
import
ViewTestCase
from
trans.tests.util
import
get_test_file
from
trans.models.unitdata
import
Suggestion
,
Comment
from
lang.models
import
Language
...
...
@@ -150,6 +151,18 @@ class CommandTest(TestCase):
)
call_command
(
'setupgroups'
,
move
=
True
)
def
test_importusers
(
self
):
# First import
call_command
(
'importusers'
,
get_test_file
(
'users.json'
))
# Test that second import does not change anything
user
=
User
.
objects
.
get
(
username
=
'weblate'
)
user
.
first_name
=
'Weblate test user'
user
.
save
()
call_command
(
'importusers'
,
get_test_file
(
'users.json'
))
user2
=
User
.
objects
.
get
(
username
=
'weblate'
)
self
.
assertEquals
(
user
.
first_name
,
user2
.
first_name
)
class
ViewTest
(
TestCase
):
'''
...
...
trans/tests/data/users.json
0 → 100644
View file @
19ac076c
[{
"first_name"
:
"First"
,
"last_name"
:
"Last"
,
"password"
:
"x"
,
"email"
:
"noreply@weblate.org"
,
"username"
:
"weblate"
}]
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