﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24362	Migration test failure on Oracle	Shai Berger	nobody	"On CI, reporoduces also on my laptop:
{{{#!python
======================================================================
ERROR [0.000s]: test_run_python_related_assignment (migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "".../tests/migrations/test_operations.py"", line 1714, in test_run_python_related_assignment
    create_old_man.database_forwards(""test_books"", editor, project_state, new_state)
  File "".../django/db/migrations/operations/special.py"", line 179, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "".../tests/migrations/test_operations.py"", line 1671, in inner_method
    author = Author.objects.create(name=""Hemingway"")
  File "".../django/db/models/manager.py"", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "".../django/db/models/query.py"", line 401, in create
    obj.save(force_insert=True, using=self.db)
  File "".../django/db/models/base.py"", line 676, in save
    force_update=force_update, update_fields=update_fields)
  File "".../django/db/models/base.py"", line 704, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "".../django/db/models/base.py"", line 788, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "".../django/db/models/base.py"", line 827, in _do_insert
    using=using, raw=raw)
  File "".../django/db/models/manager.py"", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "".../django/db/models/query.py"", line 1026, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "".../django/db/models/sql/compiler.py"", line 963, in execute_sql
    cursor.execute(sql, params)
  File "".../django/db/backends/utils.py"", line 64, in execute
    return self.cursor.execute(sql, params)
  File "".../django/db/utils.py"", line 92, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "".../django/db/backends/utils.py"", line 64, in execute
    return self.cursor.execute(sql, params)
  File "".../django/db/backends/oracle/base.py"", line 478, in execute
    return self.cursor.execute(query, self._param_generator(params))
IntegrityError: ORA-01400: cannot insert NULL into (""D_DJANGOORACLE_27"".""TEST_AUTHORS_AUTHOR"".""ID"")
}}}

Bisecting leads to the commit that added the test; it was added (failing) for #24282, and the failure was later fixed. 
The failure on Oracle is unrelated to the problem reported on the ticket, but since the solution (b29f3b51204d53c1c8745966476543d068c173a2) involved a rewrite of model reloading, it may be related."	Bug	closed	Migrations	1.8alpha1	Release blocker	fixed	oracle		Accepted	1	0	0	0	0	0
