Skip to content

Instantly share code, notes, and snippets.

@4lm
Created October 7, 2019 11:59
Show Gist options
  • Save 4lm/9b76ea736c9cf2d9440c4122bed7cc2b to your computer and use it in GitHub Desktop.
Save 4lm/9b76ea736c9cf2d9440c4122bed7cc2b to your computer and use it in GitHub Desktop.
Errors, running: manage.py test --no-input
- Running: $ python manage.py test --no-input
- Gives errors:
Creating test database for alias 'default'...
/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField TableRevision.date received a naive datetime (2019-10-07 13:56:50.976353) while time zone support is active.
RuntimeWarning)
/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField TableRevision.date received a naive datetime (2019-10-07 13:56:51.002412) while time zone support is active.
RuntimeWarning)
System check identified no issues (0 silenced).
.....SQL Action failed.
Error:
(psycopg2.ProgrammingError) FEHLER: Relation »public.api_constraints« existiert nicht
LINE 1: INSERT INTO public.api_constraints (action, constraint_type,...
^
[SQL: INSERT INTO public.api_constraints (action, constraint_type, constraint_name, constraint_parameter, reference_table, reference_column, c_schema, c_table) VALUES ('ADD', 'UNIQUE', 'number_unique', 'number', NULL, NULL , 'test' , 'population2');]
(Background on this error at: http://sqlalche.me/e/f405)
F{"reason": "IntegrityError('FEHLER: NULL-Wert in Spalte \u00bb_message\u00ab verletzt Not-Null-Constraint\\nDETAIL: Fehlgeschlagene Zeile enth\u00e4lt (1, null, MrTest, 2019-10-07 13:57:08.551194, null, null, null, null, 1, Hans).\\n')"}
F{"reason": "IntegrityError('FEHLER: NULL-Wert in Spalte \u00bb_message\u00ab verletzt Not-Null-Constraint\\nDETAIL: Fehlgeschlagene Zeile enth\u00e4lt (2, null, MrTest, 2019-10-07 13:57:08.947599, null, null, null, null, 1, Hans).\\n')"}
FFEE.{"reason": "IntegrityError(\"FEHLER: NULL-Wert in Spalte \u00bb_message\u00ab verletzt Not-Null-Constraint\\nDETAIL: Fehlgeschlagene Zeile enth\u00e4lt (5, null, MrTest, 2019-10-07 13:57:11.209383, null, null, null, null, 0, Mary Doe, Mary's Street, null).\\n\")"}
F{"reason": "IntegrityError(\"FEHLER: NULL-Wert in Spalte \u00bb_message\u00ab verletzt Not-Null-Constraint\\nDETAIL: Fehlgeschlagene Zeile enth\u00e4lt (6, null, MrTest, 2019-10-07 13:57:11.694736, null, null, null, null, 1, Mary Doe, Mary's Street, 0101000000E44A3D0B42CA51C06EC328081E214540).\\n\")"}
F{"reason": "IntegrityError(\"FEHLER: NULL-Wert in Spalte \u00bb_message\u00ab verletzt Not-Null-Constraint\\nDETAIL: Fehlgeschlagene Zeile enth\u00e4lt (7, null, MrTest, 2019-10-07 13:57:12.229452, null, null, null, null, 1, Mary Doe, Mary's Street, 0101000000E44A3D0B42CA51C06EC328081E214540).\\n\")"}
F.EEE
======================================================================
ERROR: setUpClass (api.tests.test_rows.TestDelete)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_rows.py", line 780, in setUpClass
"reason", "No reason returned"
AssertionError: IntegrityError("FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (3, null, MrTest, 2019-10-07 13:57:09.719393, null, null, null, null, 0, Mary Doe, Mary's Street, 0101000000E44A3D0B42CA51C06EC328081E214540).\n")
======================================================================
ERROR: setUpClass (api.tests.test_rows.TestGet)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_rows.py", line 601, in setUpClass
"reason", "No reason returned"
AssertionError: IntegrityError("FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (4, null, MrTest, 2019-10-07 13:57:10.415484, null, null, null, null, 0, Mary Doe, Mary's Street, 0101000000E44A3D0B42CA51C06EC328081E214540).\n")
======================================================================
ERROR: setUpClass (api.tests.test_rows.TestPut)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 220, in create_cursor
cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/__init__.py", line 39, in setUpClass
name="MrTest", email="mrtest@test.com"
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 464, in get_or_create
return self.get(**lookup), False
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 232, in __len__
self._fetch_all()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 887, in execute_sql
cursor = self.connection.cursor()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 254, in cursor
return self._cursor()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 220, in create_cursor
cursor = self.connection.cursor()
django.db.utils.InterfaceError: connection already closed
======================================================================
ERROR: setUpClass (api.tests.test_table.TestDelete)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 220, in create_cursor
cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/__init__.py", line 39, in setUpClass
name="MrTest", email="mrtest@test.com"
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 464, in get_or_create
return self.get(**lookup), False
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 232, in __len__
self._fetch_all()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 887, in execute_sql
cursor = self.connection.cursor()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 254, in cursor
return self._cursor()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 220, in create_cursor
cursor = self.connection.cursor()
django.db.utils.InterfaceError: connection already closed
======================================================================
ERROR: setUpClass (api.tests.test_table.TestPut)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 220, in create_cursor
cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/__init__.py", line 39, in setUpClass
name="MrTest", email="mrtest@test.com"
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 464, in get_or_create
return self.get(**lookup), False
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 232, in __len__
self._fetch_all()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 887, in execute_sql
cursor = self.connection.cursor()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 254, in cursor
return self._cursor()
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/base/base.py", line 231, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "/home/local/RL-INSTITUT/alexis.michaltsis/anaconda3/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 220, in create_cursor
cursor = self.connection.cursor()
django.db.utils.InterfaceError: connection already closed
======================================================================
FAIL: test (api.tests.test_integration.IntegrationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_integration.py", line 48, in test
self.step_modify_table()
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_integration.py", line 156, in step_modify_table
self.assertEqual(c_constraint_resp.status_code, 200, "Status Code is not 200.")
AssertionError: 400 != 200 : Status Code is not 200.
======================================================================
FAIL: test_270 (api.tests.test_regression.test_issue270.Test270)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_regression/test_issue270.py", line 35, in setUp
self.create_table(structure, data=data)
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/__init__.py", line 103, in create_table
load_content_as_json(resp).get("reason", "No reason returned"),
AssertionError: 400 != 201 : IntegrityError('FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (1, null, MrTest, 2019-10-07 13:57:08.551194, null, null, null, null, 1, Hans).\n')
======================================================================
FAIL: test_271 (api.tests.test_regression.test_issue271.Test271)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_regression/test_issue271.py", line 62, in setUp
load_content_as_json(resp).get("reason", "No reason returned"),
AssertionError: 400 != 201 : IntegrityError('FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (2, null, MrTest, 2019-10-07 13:57:08.947599, null, null, null, null, 1, Hans).\n')
======================================================================
FAIL: test_271_column_does_not_exist (api.tests.test_regression.test_issue271.Test271)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_regression/test_issue271.py", line 47, in setUp
resp.status_code, 201, resp.json().get("reason", "No reason returned")
AssertionError: 400 != 201 : Table already exists
======================================================================
FAIL: test_bulk_insert (api.tests.test_rows.TestPost)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_rows.py", line 504, in test_bulk_insert
load_content_as_json(response).get("reason", "No reason returned"),
AssertionError: 400 != 201 : IntegrityError("FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (5, null, MrTest, 2019-10-07 13:57:11.209383, null, null, null, null, 0, Mary Doe, Mary's Street, null).\n")
======================================================================
FAIL: test_simple_post_existing (api.tests.test_rows.TestPost)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_rows.py", line 446, in test_simple_post_existing
self.test_simple_post_new()
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_rows.py", line 382, in test_simple_post_new
load_content_as_json(response).get("reason", "No reason returned"),
AssertionError: 400 != 201 : IntegrityError("FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (6, null, MrTest, 2019-10-07 13:57:11.694736, null, null, null, null, 1, Mary Doe, Mary's Street, 0101000000E44A3D0B42CA51C06EC328081E214540).\n")
======================================================================
FAIL: test_simple_post_new (api.tests.test_rows.TestPost)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/local/RL-INSTITUT/alexis.michaltsis/projects/oep/oeplatform/api/tests/test_rows.py", line 382, in test_simple_post_new
load_content_as_json(response).get("reason", "No reason returned"),
AssertionError: 400 != 201 : IntegrityError("FEHLER: NULL-Wert in Spalte »_message« verletzt Not-Null-Constraint\nDETAIL: Fehlgeschlagene Zeile enthält (7, null, MrTest, 2019-10-07 13:57:12.229452, null, null, null, null, 1, Mary Doe, Mary's Street, 0101000000E44A3D0B42CA51C06EC328081E214540).\n")
----------------------------------------------------------------------
Ran 14 tests in 7.943s
FAILED (failures=7, errors=5)
Destroying test database for alias 'default'...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment