refactor: remove unused cleanup_draft_orders management command

The cleanup_draft_orders command was no longer needed in the project.
Also updated test output file with latest test results.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-01 16:38:00 +03:00
parent 93e4c9b600
commit eef2cb820f
2 changed files with 65 additions and 215 deletions

View File

@@ -268,92 +268,29 @@ ERROR: test_01_draft_to_completed_to_cancelled_to_completed (inventory.tests.tes
╩╨╚╥╚╫┼╤╩╚╔ ╥┼╤╥ #1: ╠эюцхёЄтхээ√х яхЁхїюф√ ьхцфє ёЄрЄєёрьш
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(7)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 80, in setUp
self._create_system_entities()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 101, in _create_system_entities
self.status_draft = OrderStatus.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='draft',
^^^^^^^^^^^^^
...<5 lines>...
order=0
^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\query.py", line 679, in create
obj.save(force_insert=True, using=self.db)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\base.py", line 822, in save
self.save_base(
~~~~~~~~~~~~~~^
using=using,
^^^^^^^^^^^^
...<2 lines>...
update_fields=update_fields,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\base.py", line 909, in save_base
updated = self._save_table(
raw,
...<4 lines>...
update_fields,
)
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\base.py", line 1071, in _save_table
results = self._do_insert(
cls._base_manager, using, fields, returning_fields, raw
)
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\base.py", line 1112, in _do_insert
return manager._insert(
~~~~~~~~~~~~~~~^
[self],
^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 83, in setUp
self._create_test_data()
~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 184, in _create_test_data
self.product = Product.objects.create(
~~~~~~~~~~~~~~~~~~~~~~^
name='╥хёЄют√щ ЄютрЁ',
^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
raw=raw,
^^^^^^^^
base_price=Decimal('10.00')
^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\query.py", line 1847, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1823, in execute_sql
cursor.execute(sql, params)
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 79, in execute
return self._execute_with_wrappers(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
sql, params, many=False, executor=self._execute
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\query.py", line 677, in create
obj = self.model(**kwargs)
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\base.py", line 567, in __init__
raise TypeError(
...<2 lines>...
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 100, in _execute
with self.db.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
django.db.utils.DataError: value too long for type character varying(7)
TypeError: Product() got unexpected keyword arguments: 'category', 'base_price'
======================================================================
ERROR: test_01_draft_to_completed_to_cancelled_to_completed (inventory.tests.test_order_status_transitions.OrderStatusTransitionCriticalTest.test_01_draft_to_completed_to_cancelled_to_completed)
@@ -441,7 +378,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(7)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
The above exception was the direct cause of the following exception:
@@ -450,14 +388,14 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 80, in setUp
self._create_system_entities()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 101, in _create_system_entities
self.status_draft = OrderStatus.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='draft',
^^^^^^^^^^^^^
...<5 lines>...
order=0
^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 156, in _create_system_entities
self.payment_method = PaymentMethod.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='cash',
^^^^^^^^^^^^
...<2 lines>...
is_active=True
^^^^^^^^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
@@ -522,7 +460,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
django.db.utils.DataError: value too long for type character varying(7)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
======================================================================
@@ -611,7 +550,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(7)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
The above exception was the direct cause of the following exception:
@@ -620,14 +560,14 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 80, in setUp
self._create_system_entities()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 101, in _create_system_entities
self.status_draft = OrderStatus.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='draft',
^^^^^^^^^^^^^
...<5 lines>...
order=0
^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 156, in _create_system_entities
self.payment_method = PaymentMethod.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='cash',
^^^^^^^^^^^^
...<2 lines>...
is_active=True
^^^^^^^^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
@@ -692,7 +632,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
django.db.utils.DataError: value too long for type character varying(7)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
======================================================================
@@ -781,7 +722,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(7)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
The above exception was the direct cause of the following exception:
@@ -790,14 +732,14 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 80, in setUp
self._create_system_entities()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 101, in _create_system_entities
self.status_draft = OrderStatus.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='draft',
^^^^^^^^^^^^^
...<5 lines>...
order=0
^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 156, in _create_system_entities
self.payment_method = PaymentMethod.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='cash',
^^^^^^^^^^^^
...<2 lines>...
is_active=True
^^^^^^^^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
@@ -862,7 +804,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
django.db.utils.DataError: value too long for type character varying(7)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
======================================================================
@@ -951,7 +894,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(7)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
The above exception was the direct cause of the following exception:
@@ -960,14 +904,14 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 80, in setUp
self._create_system_entities()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 101, in _create_system_entities
self.status_draft = OrderStatus.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='draft',
^^^^^^^^^^^^^
...<5 lines>...
order=0
^^^^^^^
File "C:\Users\team_\Desktop\test_qwen\myproject\inventory\tests\test_order_status_transitions.py", line 156, in _create_system_entities
self.payment_method = PaymentMethod.objects.create(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
code='cash',
^^^^^^^^^^^^
...<2 lines>...
is_active=True
^^^^^^^^^^^^^^
)
^
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
@@ -1032,7 +976,8 @@ Traceback (most recent call last):
File "C:\Users\team_\Desktop\test_qwen\venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
django.db.utils.DataError: value too long for type character varying(7)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "orders_paymentmethod_code_key"
DETAIL: Key (code)=(cash) already exists.
======================================================================
@@ -1114,7 +1059,7 @@ django.core.management.base.CommandError: Database test_inventory_db couldn't be
Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.
----------------------------------------------------------------------
Ran 5 tests in 7.596s
Ran 5 tests in 7.828s
FAILED (errors=10)
Destroying test database for alias 'default' ('test_inventory_db')...