summaryrefslogtreecommitdiff
path: root/tests/regressiontests/indexes/tests.py
blob: 0dac881fa95993914f5a6b9b2331f3128b138ee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from django.core.management.color import no_style
from django.db import connections, DEFAULT_DB_ALIAS
from django.test import TestCase

from .models import Article


class IndexesTests(TestCase):
    def test_index_together(self):
        connection = connections[DEFAULT_DB_ALIAS]
        index_sql = connection.creation.sql_indexes_for_model(Article, no_style())
        self.assertEqual(len(index_sql), 1)