<repo_name>dkua/django-lollllllllllllllll<file_sep>/abstract/tests.py
from django.test import TestCase
from django.db import IntegrityError

from classic.models import *


class IntegrityTest(TestCase):
    def testA(self):
        with self.assertRaises(AttributeError):
            A.objects.create()

    def testB(self):
        with self.assertRaises(IntegrityError):
            B.objects.create()

    def testC(self):
        with self.assertRaises(IntegrityError):
            C.objects.create()

    def testD(self):
        with self.assertRaises(IntegrityError):
            D.objects.create()

    def testE(self):
        with self.assertRaises(IntegrityError):
            E.objects.create()
<file_sep>/tox.ini
[tox]
skipsdist = True
envlist = py{27,34}-dj{14,15,16,17,18,19}

[testenv]
deps = 
    dj14: django>=1.4, <1.5
    dj15: django>=1.5, <1.6
    dj16: django>=1.6, <1.7
    dj17: django>=1.7, <1.8
    dj18: django>=1.8, <1.9
    dj19: django>=1.9, <1.10
commands = 
    dj{17,18,19}: {envpython} {toxinidir}/manage.py migrate
    {envpython} {toxinidir}/manage.py test classic abstract
<file_sep>/classic/models.py
from __future__ import unicode_literals

from django.db import models


class A(models.Model):
    char_id = models.CharField(max_length=20, primary_key=True)


class B(A):
    pass


class C(B):
    pass


class D(C):
    pass

class E(D):
    pass
<file_sep>/abstract/migrations/0001_initial.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='B',
            fields=[
                ('char_id', models.CharField(primary_key=True, max_length=20, serialize=False)),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='C',
            fields=[
                ('b_ptr', models.OneToOneField(primary_key=True, parent_link=True, to='abstract.B', serialize=False, auto_created=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('abstract.b',),
        ),
        migrations.CreateModel(
            name='D',
            fields=[
                ('c_ptr', models.OneToOneField(primary_key=True, parent_link=True, to='abstract.C', serialize=False, auto_created=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('abstract.c',),
        ),
        migrations.CreateModel(
            name='E',
            fields=[
                ('d_ptr', models.OneToOneField(primary_key=True, parent_link=True, to='abstract.D', serialize=False, auto_created=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('abstract.d',),
        ),
    ]
