Check your book.user_id. It shouldn’t be null. That’s what the last error
is saying.

On Mon 23. Mar 2020 at 17.44, Ejike Enyinnaya <[email protected]>
wrote:

> Good day All,
>
> I am currently running a test for my Django app call 'Books'.
>
> Anytime I run an INDEX test, I get the following error below:
>
> "File
> "/Users/macbookpro/.local/share/virtualenvs/first_django_app-mymO4nCn/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py",
> line 396, in execute
>     return Database.Cursor.execute(self, query, params)
> django.db.utils.IntegrityError: NOT NULL constraint failed:
> books_book.user_id"
>
> Please can anyone point to what the issue is or what I am doing wrong.
>
> Thanks and Regards,
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6de24eab-953f-49b9-9dc4-7aa65dc9e229%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6de24eab-953f-49b9-9dc4-7aa65dc9e229%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAipwd_qa%3DVbB0XLQ%3D-93XrqWV%3D6OY9%2BKNWUTD5HJ2yRfac24w%40mail.gmail.com.

Reply via email to