test_ldap_auth_backend.py in 4.0.10 - DJANGO_SETTINGS_MODULE ?

30 views
Skip to first unread message

Shubha Ramani

unread,
Dec 16, 2022, 3:22:41 PM12/16/22
to Review Board Community
Using Python 3.7 and installed all the dependencies including django 1.11
I am trying to run test_ldap_auth_backend.py and keep getting the error:
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

I have tried 'reviewboard.settings' and 'test_ldap_auth_backend.settings'. 
When I use the latter I get 
ImportError: cannot import name 'User' from 'django.contrib.auth.models' (C:\Users\shramani\PY37_VENV\lib\site-packages\django\contrib\auth\models.py)

Thanks,

Shubha

David Trowbridge

unread,
Dec 16, 2022, 4:52:45 PM12/16/22
to revie...@googlegroups.com
How are you running the tests? Have you set up a development environment?

David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/f8e96031-528f-4e84-856c-33340e39f51fn%40googlegroups.com.

Shubha Ramani

unread,
Dec 16, 2022, 7:29:03 PM12/16/22
to Review Board Community
I have cloned the 4.x repo.
Then simply from within the repo running python   reviewboard\accounts\tests\test_ldap_auth_backend.py
What do you mean set up a development environment ?

Shubha

David Trowbridge

unread,
Jan 10, 2023, 12:04:47 PM1/10/23
to revie...@googlegroups.com
Sorry for the late reply here.

Cloning the git repository is the first step, but you'll need to also make sure you've run some additional commands to do things like install dependencies and set up a test database. We have a full guide at https://www.notion.so/reviewboard/Getting-Started-da208d46de1d47d8b38e8b5ddcb3dd44

As far as running unit tests, the individual files are not executable. See https://www.notion.so/reviewboard/Running-Python-Unit-Tests-0f0e44ac133e4b549fbcd261d3efe4e3 for info on running the test suite, including running just the tests in a single file.

David

Reply all
Reply to author
Forward
0 new messages