This used to work for me, so not sure whether this is a new issue after upgrading my plugin from 1.13.2 to 1.15.2.
To run the tests, I get into the docker container and run pytest like this:
docker compose -f docker-compose.dev.yml exec baserow-vocabai-plugin /baserow.sh backend-cmd bash -c bash
cd /baserow/data/plugins/baserow_vocabai_plugin/backend/tests
pytest
a google search here suggests this is an import related issue, I plan on debugging this but wanted to post this in case anyone has faced the same problem.
if getattr(meta, 'app_label', None) is None:
if app_config is None:
if not abstract:
> raise RuntimeError(
"Model class %s.%s doesn't declare an explicit "
"app_label and isn't in an application in "
"INSTALLED_APPS." % (module, name)
)
E RuntimeError: Model class baserow.contrib.builder.pages.models.Page doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
/baserow/venv/lib/python3.9/site-packages/django/db/models/base.py:113: RuntimeError
============================================================================================================= ERRORS ==============================================================================================================________________________________________________________________________________ ERROR at setup of test_can_query_starting_endpoint_as_authed_user ________________________________________________________________________________
@pytest.fixture
def data_fixture():
> from .fixtures import Fixtures
/baserow/backend/src/baserow/test_utils/pytest_conftest.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _/baserow/backend/src/baserow/test_utils/fixtures/__init__.py:4: in <module>
from .application import ApplicationFixtures
/baserow/backend/src/baserow/test_utils/fixtures/application.py:1: in <module>
from baserow.contrib.builder.models import Builder
/baserow/backend/src/baserow/contrib/builder/models.py:1: in <module>
from baserow.contrib.builder.pages.models import Page
/baserow/backend/src/baserow/contrib/builder/pages/models.py:22: in <module>
class Page(
/usr/lib/python3.9/abc.py:85: in __new__
cls = super().__new__(mcls, name, bases, namespace, **kwargs)