Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on tests #7

Open
meomancer opened this issue Jun 6, 2024 · 0 comments
Open

Fix error on tests #7

meomancer opened this issue Jun 6, 2024 · 0 comments

Comments

@meomancer
Copy link
Collaborator

Error
ImportError: Failed to import test module: django_project.cloud_native_gis.admin
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/unittest/loader.py", line 415, in _find_test_path
    package = self._get_module_from_name(name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/unittest/loader.py", line 325, in _get_module_from_name
    __import__(name)
  File "/tmp/pycharm_project_27/django_project/cloud_native_gis/admin/__init__.py", line 4, in <module>
    from .general import *
  File "/tmp/pycharm_project_27/django_project/cloud_native_gis/admin/general.py", line 17, in <module>
    admin.site.register(License, LicenseAdmin)
  File "/usr/local/lib/python3.12/site-packages/django/contrib/admin/sites.py", line 132, in register
    raise AlreadyRegistered(msg)
django.contrib.admin.sites.AlreadyRegistered: The model License is already registered with 'cloud_native_gis.LicenseAdmin'.
Error
ImportError: Failed to import test module: django_project.cloud_native_gis.models
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/unittest/loader.py", line 415, in _find_test_path
    package = self._get_module_from_name(name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/unittest/loader.py", line 325, in _get_module_from_name
    __import__(name)
  File "/tmp/pycharm_project_27/django_project/cloud_native_gis/models/__init__.py", line 3, in <module>
    from .general import *
  File "/tmp/pycharm_project_27/django_project/cloud_native_gis/models/general.py", line 44, in <module>
    class License(AbstractTerm):
  File "/usr/local/lib/python3.12/site-packages/django/db/models/base.py", line 134, in __new__
    raise RuntimeError(
RuntimeError: Model class django_project.cloud_native_gis.models.general.License doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
django.db.utils.OperationalError: database "test_django" is being accessed by other users
DETAIL:  There is 1 other session using the database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant