Merge pull request #11603 from edx/usman/migrations-setup
Update migrations setup during Python unit tests
This commit is contained in:
@@ -231,3 +231,16 @@ def generate_int_id(minimum=0, maximum=MYSQL_MAX_INT, used_ids=None):
|
||||
cid = random.randint(minimum, maximum)
|
||||
|
||||
return cid
|
||||
|
||||
|
||||
class NoOpMigrationModules(object):
|
||||
"""
|
||||
Return invalid migrations modules for apps. Used for disabling migrations during tests.
|
||||
See https://groups.google.com/d/msg/django-developers/PWPj3etj3-U/kCl6pMsQYYoJ.
|
||||
"""
|
||||
|
||||
def __contains__(self, item):
|
||||
return True
|
||||
|
||||
def __getitem__(self, item):
|
||||
return "notmigrations"
|
||||
|
||||
Reference in New Issue
Block a user