Модульные тесты Django терпят неудачу при настройке кода в библиотеке базы данных?

#django #testing #django-orm #django-south #django-testing

#django #тестирование #django-orm #django-юг #django-тестирование

Вопрос:

Рассмотрим следующее:

 (oneclickcos) C:UsersMarcinDocumentsoneclickcosoneclickcosoneclickcos>python 

manage.py test mainapp
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagement__init__.py", line 438, in execute_manager
    utility.execute()
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagement__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagementbase.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagementbase.py", line 220, in execute
    output = self.handle(*args, **options)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmanagementcommandstest.py", line 8, in handle
    super(Command, self).handle(*args, **kwargs)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagementcommandstest.py", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangotestsimple.py", line 359, in run_tests
    old_config = self.setup_databases()
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangotestsimple.py", line 296, in setup_databases
    test_db_name = connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangodbbackendscreation.py", line 366, in create_test_db
    load_initial_data=False)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagement__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagementbase.py", line 220, in execute
    output = self.handle(*args, **options)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagementbase.py", line 351, in handle
    return self.handle_noargs(**options)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmanagementcommandssyncdb.py", line 99, in handle_noargs
    management.call_command('migrate', **options)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagement__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangocoremanagementbase.py", line 220, in execute
    output = self.handle(*args, **options)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmanagementcommandsmigrate.py", line 105, in handle
    ignore_ghosts = ignore_ghosts,
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigration__init__.py", line 191, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigrationmigrators.py", line 221, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigrationmigrators.py", line 292, in migrate_many
    result = self.migrate(migration, database)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigrationmigrators.py", line 125, in migrate
    result = self.run(migration)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigrationmigrators.py", line 99, in run
    return self.run_migration(migration)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigrationmigrators.py", line 81, in run_migration
    migration_function()
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthmigrationmigrators.py", line 57, in <lambda>
    return (lambda: direction(orm))
  File "C:UsersMarcinDocumentsoneclickcosoneclickcosoneclickcosmainappmigrations006_auto__del_field_membergeneric_company__del_field_membergeneric_mem
ber_.py", line 12, in forwards
    db.delete_column('mainapp_membergeneric', 'company_id')
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthdbsqlite3.py", line 187, in delete_column
    self._remake_table(table_name, deleted=[column_name])
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthdbsqlite3.py", line 80, in _remake_table
    ", ".join(["%s %s" % (self.quote_name(cname), ctype) for cname, ctype in definitions.items()]),
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagessouthdbgeneric.py", line 150, in execute
    cursor.execute(sql, params)
  File "C:UsersMarcinDocumentsoneclickcoslibsite-packagesdjangodbbackendssqlite3base.py", line 234, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: near ")": syntax error
 

Глядя на это, похоже, что ошибка, на которую жаловались, заключается в том, что ORM Django генерирует неверный SQL. Учитывая, что это мешает мне даже запускать тесты, куда мне идти дальше?

Редактировать: похоже, что путь выполнения проходит через миграцию. Это код этой миграции:

 # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Deleting field 'MemberGeneric.company'
        db.delete_column('mainapp_membergeneric', 'company_id')

        # Deleting field 'MemberGeneric.member'
        db.delete_column('mainapp_membergeneric', 'member_id')

        # Deleting field 'MemberGeneric.id'
        db.delete_column('mainapp_membergeneric', 'id')

        # Adding field 'MemberGeneric.member_ptr'
        db.add_column('mainapp_membergeneric', 'member_ptr', self.gf('django.db.models.fields.related.OneToOneField')(default='dummy', to=orm['mainapp.Member'], unique=True, primary_key=True), keep_default=False)

        # Deleting field 'DirectorsIndividual.director'
        db.delete_column('mainapp_directorsindividual', 'director_id')

        # Deleting field 'DirectorsIndividual.company'
        db.delete_column('mainapp_directorsindividual', 'company_id')

        # Deleting field 'DirectorsIndividual.id'
        db.delete_column('mainapp_directorsindividual', 'id')

        # Adding field 'DirectorsIndividual.director_ptr'
        db.add_column('mainapp_directorsindividual', 'director_ptr', self.gf('django.db.models.fields.related.OneToOneField')(default='dummy', to=orm['mainapp.Director'], unique=True, primary_key=True), keep_default=False)

        # Deleting field 'MembersIndividual.member'
        db.delete_column('mainapp_membersindividual', 'member_id')

        # Deleting field 'MembersIndividual.company'
        db.delete_column('mainapp_membersindividual', 'company_id')

        # Deleting field 'MembersIndividual.id'
        db.delete_column('mainapp_membersindividual', 'id')

        # Adding field 'MembersIndividual.member_ptr'
        db.add_column('mainapp_membersindividual', 'member_ptr', self.gf('django.db.models.fields.related.OneToOneField')(default='dummy', to=orm['mainapp.Member'], unique=True, primary_key=True), keep_default=False)

        # Deleting field 'DirectorsCorporate.company'
        db.delete_column('mainapp_directorscorporate', 'company_id')

        # Deleting field 'DirectorsCorporate.director'
        db.delete_column('mainapp_directorscorporate', 'director_id')

        # Deleting field 'DirectorsCorporate.id'
        db.delete_column('mainapp_directorscorporate', 'id')

        # Adding field 'DirectorsCorporate.director_ptr'
        db.add_column('mainapp_directorscorporate', 'director_ptr', self.gf('django.db.models.fields.related.OneToOneField')(default='dummy', to=orm['mainapp.Director'], unique=True, primary_key=True), keep_default=False)


    def backwards(self, orm):

        # Adding field 'MemberGeneric.company'
        db.add_column('mainapp_membergeneric', 'company', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.CompanyUK']), keep_default=False)

        # Adding field 'MemberGeneric.member'
        db.add_column('mainapp_membergeneric', 'member', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.Member']), keep_default=False)

        # Adding field 'MemberGeneric.id'
        db.add_column('mainapp_membergeneric', 'id', self.gf('django.db.models.fields.AutoField')(default='dummy', primary_key=True), keep_default=False)

        # Deleting field 'MemberGeneric.member_ptr'
        db.delete_column('mainapp_membergeneric', 'member_ptr_id')

        # Adding field 'DirectorsIndividual.director'
        db.add_column('mainapp_directorsindividual', 'director', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.Director']), keep_default=False)

        # Adding field 'DirectorsIndividual.company'
        db.add_column('mainapp_directorsindividual', 'company', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.CompanyUK']), keep_default=False)

        # Adding field 'DirectorsIndividual.id'
        db.add_column('mainapp_directorsindividual', 'id', self.gf('django.db.models.fields.AutoField')(default='dummy', primary_key=True), keep_default=False)

        # Deleting field 'DirectorsIndividual.director_ptr'
        db.delete_column('mainapp_directorsindividual', 'director_ptr_id')

        # Adding field 'MembersIndividual.member'
        db.add_column('mainapp_membersindividual', 'member', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.Member']), keep_default=False)

        # Adding field 'MembersIndividual.company'
        db.add_column('mainapp_membersindividual', 'company', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.CompanyUK']), keep_default=False)

        # Adding field 'MembersIndividual.id'
        db.add_column('mainapp_membersindividual', 'id', self.gf('django.db.models.fields.AutoField')(default='dummy', primary_key=True), keep_default=False)

        # Deleting field 'MembersIndividual.member_ptr'
        db.delete_column('mainapp_membersindividual', 'member_ptr_id')

        # Adding field 'DirectorsCorporate.company'
        db.add_column('mainapp_directorscorporate', 'company', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.CompanyUK']), keep_default=False)

        # Adding field 'DirectorsCorporate.director'
        db.add_column('mainapp_directorscorporate', 'director', self.gf('django.db.models.fields.related.ForeignKey')(default='dummy', to=orm['mainapp.Director']), keep_default=False)

        # Adding field 'DirectorsCorporate.id'
        db.add_column('mainapp_directorscorporate', 'id', self.gf('django.db.models.fields.AutoField')(default='dummy', primary_key=True), keep_default=False)

        # Deleting field 'DirectorsCorporate.director_ptr'
        db.delete_column('mainapp_directorscorporate', 'director_ptr_id')


    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'mainapp.companymanager': {
            'Meta': {'object_name': 'CompanyManager'},
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.CompanyUK']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
        },
        'mainapp.companyname': {
            'Meta': {'object_name': 'CompanyName'},
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.CompanyUK']"}),
            'date_adopted': ('django.db.models.fields.DateField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'mainapp.companyuk': {
            'Meta': {'object_name': 'CompanyUK'},
            'business_nature': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'company_number': ('django.db.models.fields.CharField', [], {'max_length': '15', 'primary_key': 'True'}),
            'company_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'incorporation_date': ('django.db.models.fields.DateField', [], {}),
            'last_accounts_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'last_return_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'next_accounts_date': ('django.db.models.fields.DateField', [], {}),
            'next_return_date': ('django.db.models.fields.DateField', [], {}),
            'registered_office': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
            'registration_country': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'status': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        },
        'mainapp.director': {
            'Meta': {'object_name': 'Director'},
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.CompanyUK']"}),
            'date_ceased_to_act': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'date_of_appointment': ('django.db.models.fields.DateField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_secretary': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'representative_for': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'representative'", 'blank': 'True', 'null': 'True', 'to': "orm['mainapp.Director']"}),
            'surrogate_for': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'surrogate'", 'blank': 'True', 'null': 'True', 'to': "orm['mainapp.Director']"})
        },
        'mainapp.directorscorporate': {
            'Meta': {'object_name': 'DirectorsCorporate', '_ormbases': ['mainapp.Director']},
            'company_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'director_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['mainapp.Director']", 'unique': 'True', 'primary_key': 'True'}),
            'governing_law': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'legal_form': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'registration_number': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'representative_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
            'service_address': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),
            'where_registered': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'})
        },
        'mainapp.directorsindividual': {
            'Meta': {'object_name': 'DirectorsIndividual', '_ormbases': ['mainapp.Director']},
            'director_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['mainapp.Director']", 'unique': 'True', 'primary_key': 'True'}),
            'individual': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.Individual']"})
        },
        'mainapp.individual': {
            'Meta': {'object_name': 'Individual'},
            'business_occupation': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'country_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'dob': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'driving_licence_number': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'eye_colour': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'fathers_first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'mothers_maiden_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'national_insurance_number': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'passport_number': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'residential_address': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),
            'service_address': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}),
            'surname': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'town_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
            'verified_on_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})
        },
        'mainapp.member': {
            'Meta': {'object_name': 'Member'},
            'amount': ('django.db.models.fields.IntegerField', [], {}),
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.CompanyUK']"}),
            'date_entry_superseded': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'date_registered': ('django.db.models.fields.DateField', [], {}),
            'holding_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.ShareCapitalClass']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        'mainapp.membergeneric': {
            'Meta': {'object_name': 'MemberGeneric', '_ormbases': ['mainapp.Member']},
            'address': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}),
            'member_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['mainapp.Member']", 'unique': 'True', 'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
        },
        'mainapp.membersindividual': {
            'Meta': {'object_name': 'MembersIndividual', '_ormbases': ['mainapp.Member']},
            'individual': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.Individual']"}),
            'member_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['mainapp.Member']", 'unique': 'True', 'primary_key': 'True'})
        },
        'mainapp.pendingauthorisation': {
            'Meta': {'object_name': 'PendingAuthorisation'},
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.CompanyUK']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'roles': ('picklefield.fields.PickledObjectField', [], {}),
            'secret': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
        },
        'mainapp.pendingregistration': {
            'Meta': {'object_name': 'PendingRegistration'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'secret': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
        },
        'mainapp.sharecapitalclass': {
            'Meta': {'object_name': 'ShareCapitalClass'},
            'amount_issued': ('django.db.models.fields.IntegerField', [], {}),
            'class_name': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mainapp.CompanyUK']"}),
            'currency': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'description': ('django.db.models.fields.CharField', [], {'max_length': '9900'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_stock': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'max_allowed': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'nominal_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'})
        },
        'mainapp.testchild': {
            'Meta': {'object_name': 'TestChild', '_ormbases': ['mainapp.TestParent']},
            'b': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'testparent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['mainapp.TestParent']", 'unique': 'True', 'primary_key': 'True'})
        },
        'mainapp.testparent': {
            'Meta': {'object_name': 'TestParent'},
            'a': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        }
    }

    complete_apps = ['mainapp']
 

В случае, если это актуально, я использую Юг.

Действительно ли это ошибка в компоненте Django, или это происходит откуда-то из моего кода? Если это мой код, где я должен искать и что я должен искать?

Комментарии:

1. @ArturM: Есть ли решение? (Я добавлю, что я использую Юг, которым я являюсь).

2. Может быть, поможет настройка SKIP_SOUTH_TESTS = True или SOUTH_TESTS_MIGRATE = False

3. Покажите нам mainappmigrations006_auto__del_field_membergeneric_company__del_field_membergeneric_member_.py файл миграции