Skip test model tests when using MySQL
MySQL doesn't support schema changes inside an atomic block. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -284,6 +284,13 @@ class TempfileCheckTestCasekMixin(object):
|
|||||||
|
|
||||||
class TestModelTestMixin(object):
|
class TestModelTestMixin(object):
|
||||||
def _create_test_model(self, fields=None, model_name='TestModel', options=None):
|
def _create_test_model(self, fields=None, model_name='TestModel', options=None):
|
||||||
|
|
||||||
|
if connection.vendor == 'mysql':
|
||||||
|
self.skipTest(
|
||||||
|
reason='MySQL doesn\t support schema changes inside an '
|
||||||
|
'atomic block.'
|
||||||
|
)
|
||||||
|
|
||||||
# Obtain the app_config and app_label from the test's module path
|
# Obtain the app_config and app_label from the test's module path
|
||||||
app_config = apps.get_containing_app_config(
|
app_config = apps.get_containing_app_config(
|
||||||
object_name=self.__class__.__module__
|
object_name=self.__class__.__module__
|
||||||
|
|||||||
Reference in New Issue
Block a user