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
90c670c0
Commit
90c670c0
authored
Mar 25, 2016
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit test to check the migrations are in sync.
parent
68ae1325
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
common/djangoapps/util/tests/test_db.py
+15
-0
No files found.
common/djangoapps/util/tests/test_db.py
View file @
90c670c0
...
...
@@ -6,6 +6,7 @@ import time
import
unittest
from
django.contrib.auth.models
import
User
from
django.core.management
import
call_command
from
django.db
import
connection
,
IntegrityError
from
django.db.transaction
import
atomic
,
TransactionManagementError
from
django.test
import
TestCase
,
TransactionTestCase
...
...
@@ -161,3 +162,17 @@ class GenerateIntIdTestCase(TestCase):
for
i
in
range
(
times
):
int_id
=
generate_int_id
(
minimum
,
maximum
,
used_ids
)
self
.
assertIn
(
int_id
,
list
(
set
(
range
(
minimum
,
maximum
+
1
))
-
used_ids
))
class
MigrationTests
(
TestCase
):
"""
Tests for migrations.
"""
def
test_migrations_are_in_sync
(
self
):
"""
Tests that the migration files are in sync with the models.
If this fails, you needs to run the Django command makemigrations.
"""
with
self
.
assertRaises
(
SystemExit
):
call_command
(
'makemigrations'
,
'-e'
)
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