Код: Выделить всё
Traceback (most recent call last):
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/activities/tests/test_join.py", line 26, in test_join_unjoinable
activity = create_activity("UnJoinable", 1, 10, 10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/activities/tests/shortcuts.py", line 8, in create_activity
activity = models.Activity.objects.create()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/query.py", line 679, in create
obj.save(force_insert=True, using=self.db)
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/base.py", line 891, in save
self.save_base(
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/base.py", line 997, in save_base
updated = self._save_table(
^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/base.py", line 1160, in _save_table
results = self._do_insert(
^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/base.py", line 1201, in _do_insert
return manager._insert(
^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/query.py", line 1847, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1836, in execute_sql
cursor.execute(sql, params)
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 99, in _execute
self.db.validate_no_broken_transaction()
File "/Users/Ohm/Desktop/Ohm_project/ISP/ISP_project/ku-tangtee/env/lib/python3.11/site-packages/django/db/backends/base/base.py", line 521, in validate_no_broken_transaction
raise TransactionManagementError(
django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.
Я пытаюсь создать для него новую новую базу данных и установить для ATOMIC_REQUESTS в настройках значение False, но результат все те же. Я не уверен, что мне нужно что-то настраивать в MySQL или Django. Также все тесты прошли на машине моего друга, а также в Github CI.
Подробнее здесь: https://stackoverflow.com/questions/790 ... -in-django