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
2c130acf
Commit
2c130acf
authored
Apr 20, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test to use migrations
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
80e7a9b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
15 deletions
+5
-15
weblate/api/tests.py
weblate/api/tests.py
+3
-1
weblate/settings_test.py
weblate/settings_test.py
+0
-14
weblate/trans/management/commands/auto_translate.py
weblate/trans/management/commands/auto_translate.py
+2
-0
No files found.
weblate/api/tests.py
View file @
2c130acf
...
...
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
,
Group
from
django.core.cache
import
cache
from
django.core.urlresolvers
import
reverse
...
...
@@ -66,6 +66,8 @@ class APIBaseTest(APITestCase, RepoTestMixin):
def
authenticate
(
self
,
superuser
=
False
):
user
,
dummy
=
User
.
objects
.
get_or_create
(
username
=
'test'
)
group
=
Group
.
objects
.
get
(
name
=
'Users'
)
user
.
groups
.
add
(
group
)
user
.
is_superuser
=
superuser
user
.
save
()
cache
.
delete
(
get_acl_cache_key
(
user
))
...
...
weblate/settings_test.py
View file @
2c130acf
...
...
@@ -110,20 +110,6 @@ AUTHENTICATION_BACKENDS = (
'weblate.accounts.auth.WeblateUserBackend'
,
)
class
DisableMigrations
(
object
):
"""Magic to disable migrations"""
def
__contains__
(
self
,
item
):
return
True
def
__getitem__
(
self
,
item
):
return
"notmigrations"
# Avoid running migrations in testsuite
if
'TEST_MIGRATIONS'
not
in
os
.
environ
:
MIGRATION_MODULES
=
DisableMigrations
()
warnings
.
filterwarnings
(
'error'
,
r"DateTimeField .* received a naive datetime"
,
RuntimeWarning
,
r'django\
.d
b\
.models
\.fields'
...
...
weblate/trans/management/commands/auto_translate.py
View file @
2c130acf
...
...
@@ -21,6 +21,7 @@
from
django.core.management.base
import
CommandError
from
django.contrib.auth.models
import
User
from
weblate.accounts.models
import
Profile
from
weblate.trans.models
import
SubProject
from
weblate.trans.autotranslate
import
auto_translate
from
weblate.trans.management.commands
import
WeblateTranslationCommand
...
...
@@ -72,6 +73,7 @@ class Command(WeblateTranslationCommand):
# Get user
try
:
user
=
User
.
objects
.
get
(
username
=
options
[
'user'
])
Profile
.
objects
.
get_or_create
(
user
=
user
)
except
User
.
DoesNotExist
:
raise
CommandError
(
'User does not exist!'
)
...
...
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