summaryrefslogtreecommitdiff
path: root/lib/python2.7/site-packages/south/tests/db_firebird.py
blob: 2b6bd532023c86a9c3020094c112c2a0e396b5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from django.db import models

from south.db import db
from south.tests import unittest, skipUnless


class FirebirdTests(unittest.TestCase):

    """
    Tests firebird related issues
    """

    def setUp(self):
        print('=' * 80)
        print('Begin Firebird test')

    def tearDown(self):
        print('End Firebird test')
        print('=' * 80)

    @skipUnless(db.backend_name == "firebird", "Firebird-only test")
    def test_firebird_double_index_creation_1317(self):
        """
        Tests foreign key creation, especially uppercase (see #61)
        """
        Test = db.mock_model(model_name='Test',
            db_table='test5a',
            db_tablespace='',
            pk_field_name='ID',
            pk_field_type=models.AutoField,
            pk_field_args=[]
        )
        db.create_table("test5a", [('ID', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True))])
        db.create_table("test5b", [
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('UNIQUE', models.ForeignKey(Test)),
        ])
        db.execute_deferred_sql()