Pastebin
Paste #25069: No description
< previous paste - next paste>
Pasted by Anonymous Coward
python.exe .\manage.py test
Found 7 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
E
======================================================================
ERROR: setUpClass (crm.test.test_models.TestProjectCode)
----------------------------------------------------------------------
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_project.id
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\project\venv\Lib\site-packages\django\test\testcases.py", line 1466, in setUpClass
cls.setUpTestData()
File "C:\project\crm\test\test_models.py", line 12, in setUpTestData
cls.project = Project.objects.create(name='Test Project', customer=cls.customer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 242, 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(
^^^^^^^^^^^^^^^^^
New Paste
Go to most recent paste.