Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
54b50341
Commit
54b50341
authored
Aug 23, 2017
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified migrations sync test.
parent
b0690207
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
common/djangoapps/util/tests/test_db.py
+13
-2
No files found.
common/djangoapps/util/tests/test_db.py
View file @
54b50341
...
...
@@ -5,12 +5,14 @@ import time
import
unittest
import
ddt
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.core.management
import
call_command
from
django.db
import
IntegrityError
,
connection
from
django.db.transaction
import
TransactionManagementError
,
atomic
from
django.test
import
TestCase
,
TransactionTestCase
from
django.test.utils
import
override_settings
from
django.utils.six
import
StringIO
from
util.db
import
NoOpMigrationModules
,
commit_on_success
,
enable_named_outer_atomic
,
generate_int_id
,
outer_atomic
...
...
@@ -221,5 +223,14 @@ class MigrationTests(TestCase):
The test is set up to override MIGRATION_MODULES to ensure migrations are
enabled for purposes of this test regardless of the overall test settings.
"""
with
self
.
assertRaises
(
SystemExit
):
call_command
(
'makemigrations'
,
'-e'
)
out
=
StringIO
()
call_command
(
'makemigrations'
,
dry_run
=
True
,
verbosity
=
3
,
stdout
=
out
)
output
=
out
.
getvalue
()
# Temporary check, remove it once migration is created and use the else part.
if
settings
.
ROOT_URLCONF
==
'lms.urls'
:
migrations_count
=
output
.
count
(
'Migrations for'
)
self
.
assertIn
(
'Remove field sailthru_activation_template'
,
output
)
self
.
assertEqual
(
migrations_count
,
1
)
else
:
self
.
assertIn
(
'No changes detected'
,
output
)
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