1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Reorganized backends tests.

This commit is contained in:
Mariusz Felisiak
2017-02-11 21:37:49 +01:00
committed by Tim Graham
parent 0f91ba1adc
commit 8cb1b1fd8e
21 changed files with 731 additions and 710 deletions

View File

@@ -0,0 +1,19 @@
from unittest import mock, skipUnless
from django.db import connection
from django.test import TestCase
@skipUnless(connection.vendor == 'mysql', 'MySQL tests')
class TestFeatures(TestCase):
def test_supports_transactions(self):
"""
All storage engines except MyISAM support transactions.
"""
with mock.patch('django.db.connection.features._mysql_storage_engine', 'InnoDB'):
self.assertTrue(connection.features.supports_transactions)
del connection.features.supports_transactions
with mock.patch('django.db.connection.features._mysql_storage_engine', 'MyISAM'):
self.assertFalse(connection.features.supports_transactions)
del connection.features.supports_transactions