#18738: manage.py loaddata returns 0 despite fixture load failure -------------------------------+-------------------- Reporter: lorinh | Owner: nobody Type: Uncategorized | Status: new Component: Uncategorized | Version: 1.4 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+-------------------- I tried to load some fixtures with the PostgreSQL backend and got an integrity error because the fixtures were in the wrong order:
{{{ $ python manage.py loaddata fixtures.yaml Problem installing fixture 'fixtures.yaml.bz2': Traceback (most recent call last): File "/Users/lorin/.virtualenvs/venv/src/django/django/core/management/commands/loaddata.py", line 226, in handle connection.check_constraints(table_names=table_names) File "/Users/lorin/.virtualenvs/venv/src/django/django/db/backends/postgresql_psycopg2/base.py", line 129, in check_constraints self.cursor().execute('SET CONSTRAINTS ALL IMMEDIATE') File "/Users/lorin/.virtualenvs/venv/src/django/django/db/backends/util.py", line 40, in execute return self.cursor.execute(sql, params) File "/Users/lorin/.virtualenvs/venv/src/django/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute return self.cursor.execute(query, args) IntegrityError: insert or update on table "shop_product" violates foreign key constraint "shop_product_product_ptr_id_fkey" DETAIL: Key (product_ptr_id)=(1) is not present in table "shop_product". }}} I expected the return code to indicate failure. However, it returned success: {{{ $ echo $? 0 }}} This is problematic in environments when relying on the return code to indicate success or failure. -- Ticket URL: <https://code.djangoproject.com/ticket/18738> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.