Django unable to load test fixtures, IntegrityError

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/codehunter

Our great sponsors
  • JetBrains - Developer Ecosystem Survey 2022
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • saleor

    A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React. [Moved to: https://github.com/saleor/saleor] (by mirumee)

    I'm using Saleor/Satchless to power and e-commerce site (inherited the project). I couldn't find a Saleor mailing list so posting here instead.

  • django-fixture-magic

    Utilities to extract and manipulate Django Fixtures.

    ======================================================================ERROR: test__hometryon_extra_pair_sizes (payment.tests.InterstitialTestCase)----------------------------------------------------------------------Traceback (most recent call last): File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 259, in __call__self._pre_setup() File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 479, in _pre_setupself._fixture_setup() File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 849, in _fixture_setup'skip\_validation': True, File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/\_\_init\_\_.py", line 161, in call_commandreturn klass.execute(*args, **defaults) File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/base.py", line 255, in executeoutput = self.handle(*args, **options) File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 224, in handleconnection.check_constraints(table_names=table_names) File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql\_psycopg2/base.py", line 132, in check_constraintsself.cursor().execute('SET CONSTRAINTS ALL IMMEDIATE') File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql\_psycopg2/base.py", line 56, in executesix.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2]) File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql\_psycopg2/base.py", line 54, in executereturn self.cursor.execute(query, args)IntegrityError: Problem installing fixtures: insert or update on table "product\_ship" violates foreign key constraint "product\_ship\_product\_ptr\_id\_fkey"DETAIL: Key (product_ptr_id)=(1) is not present in table "product\_product". Update: Started playing around with django-fixture-magic I discovered that product.product is not actually being dumped even when I do a $ python manage.py dumpdata --indent=4 --all -e contenttypes -e sessions -e south > fulldb.json

  • JetBrains

    Developer Ecosystem Survey 2022. Take part in the Developer Ecosystem Survey 2022 by JetBrains and get a chance to win a Macbook, a Nvidia graphics card, or other prizes. We’ll create an infographic full of stats, and you’ll get personalized results so you can compare yourself with other developers.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts