Please see the call stack too ,for one of the error
"C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\admin_filters\tests.py",
line 229, in setUp
self.alfred = User.objects.create_user('alfred', '[email protected]')
File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line
187, in create_user
**extra_fields)
File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line
182, in _create_user
user.save(using=self._db)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 710, in
save
force_update=force_update, update_fields=update_fields)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 738, in
save_base
updated = self._save_table(raw, cls, force_insert, force_update, using,
update_fields)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 822, in
_save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 861, in
_do_insert
using=using, raw=raw)
File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 127,
in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 920,
in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line
974, in execute_sql
cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\utils.py", line 67,
in execute
return self.cursor.execute(sql, params)
File
"c:\python27\lib\site-packages\ibm_db_django-1.0.7-py2.7.egg\ibm_db_django\pybase.py",
line 165, in execute
six.reraise(utils.IntegrityError, utils.IntegrityError( *tuple( six.PY3 and
e.args or ( e._message, ) ) ), sys.exc_info()[2])
File
"c:\python27\lib\site-packages\ibm_db_django-1.0.7-py2.7.egg\ibm_db_django\pybase.py",
line 161, in execute
return super( DB2CursorWrapper, self ).execute( operation, parameters )
File
"c:\python27\lib\site-packages\ibm_db-2.0.5.1-py2.7.egg\ibm_db_dbi.py",
line 1335, in execute
self._execute_helper(parameters)
File
"c:\python27\lib\site-packages\ibm_db-2.0.5.1-py2.7.egg\ibm_db_dbi.py",
line 1247, in _execute_helper
raise self.messages[len(self.messages) - 1]
IntegrityError: Statement Execute Failed: [IBM][CLI Driver][DB2/NT]
SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=2,
TABLEID=24, COLNO=5" is not allowed. SQLSTATE=23502\r SQLCODE=-407
On Monday, September 21, 2015 at 4:44:39 PM UTC+5:30, Jose Paul wrote:
>
> I am trying to run DJango 1.8 test cases with DB2
>
> Several insert statement fails
>
> Here is the insert command generated by test case.
>
> INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER",
> "USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE",
> "DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
>
> Value : (None, None, True, u'superuser', None, None, None, False, True,
> u'2015-09-17 12:31:09.562000')
>
> ibm_db_dbi::IntegrityError: Statement Execute Failed: [IBM][CLI
> Driver][DB2/NT] SQL0407N Assignment of a NULL value to a NOT NULL column
> "TBSPACEID=2, TABLEID=24, COLNO=1" is not allowed. SQLSTATE=23502\r
> SQLCODE=-407
>
>
> Except last_login none of the field are nullable .
> But still DJango testcase generate insert statement as above and pass
> None as value which fails .
>
> Why this happens ?.
> Why correct non null values are not generated for non null field .
>
> Please help .Thanks ,
> Jose
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/7d38d707-138b-4acc-baab-089ae089c228%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.