Pastebin
Paste #25070: No description
< previous paste - next paste>
Pasted by Anonymous Coward
Found 1 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
E
======================================================================
ERROR: test_field_code_is_generated_on_initial_creation (crm.test.test_models.TestProjectCode.test_field_code_is_generated_on_initial_creation)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\project\venv\Lib\site-packages\django\db\backends\utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 328, in execute
return super().execute(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: UNIQUE constraint failed: crm_projectcode.id
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\project\crm\test\test_models.py", line 28, in test_field_code_is_generated_on_initial_creation
project_code = ProjectCode.objects.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\query.py", line 658, in create
obj.save(force_insert=True, using=self.db)
File "C:\project\crm\models.py", line 278, in save
return super().save(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\base.py", line 814, in save
self.save_base(
File "C:\project\venv\Lib\site-packages\django\db\models\base.py", line 877, in save_base
updated = self._save_table(
^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\base.py", line 1020, in _save_table
results = self._do_insert(
^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\base.py", line 1061, in _do_insert
return manager._insert(
^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\query.py", line 1805, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1820, in execute_sql
cursor.execute(sql, params)
File "C:\project\venv\Lib\site-packages\django\db\backends\utils.py", line 102, in execute
return super().execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\backends\utils.py", line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\project\venv\Lib\site-packages\django\db\backends\sqlite3\base.py", line 328, in execute
return super().execute(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.IntegrityError: UNIQUE constraint failed: crm_projectcode.id
----------------------------------------------------------------------
Ran 1 test in 0.009s
FAILED (errors=1)
Destroying test database for alias 'default'...
New Paste
Go to most recent paste.