Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active June 9, 2021 13:33
Show Gist options
  • Save velotiotech/520dfdaa5b38ab47eb9f0ac819dd03b3 to your computer and use it in GitHub Desktop.
Save velotiotech/520dfdaa5b38ab47eb9f0ac819dd03b3 to your computer and use it in GitHub Desktop.
$ pytest
============================= test session starts ==============================
platform linux -- Python 3.7.0, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
django: settings: pytest_fixtures.settings (from ini)
rootdir: /home/suraj/PycharmProjects/e_commerce_app, configfile: pytest.ini
plugins: django-4.1.0
collected 1 item
product/tests/test_models.py E [100%]
==================================== ERRORS ====================================
______________ ERROR at setup of test_two_different_books_create _______________
...
query = 'INSERT INTO "product_category" ("name") VALUES (?)', params = ['Books']
...
E django.db.utils.IntegrityError: UNIQUE constraint failed: product_category.name
venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py:413: IntegrityError
=========================== short test summary info ============================
ERROR product/tests/test_models.py::test_two_different_books_create - django....
=============================== 1 error in 0.44s ===============================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment