If otp_yubikey is installed in current environment (venv), but absent in INSTALLED_APPS, then tests which use login should work.
Current Behavior
Tests crash with:
RuntimeError: Model class otp_yubikey.models.YubikeyDevice doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Possible Solution
Instead of trying to import otp_yubikey and catching ImportError you can check if otp_yubikey is present in INSTALLED_APPS.
Steps to Reproduce (for bugs)
Well, I don't have minimal example, but here is the change I am working (patchset 2 failed due to this problem). I have ran it locally and pasted the reason above.
https://gerrit.sio2project.mimuw.edu.pl/#/c/2946/
Your Environment
Browser and version: Google Chrome 64.0.3282.167 64-bit
Python version: 2.7.6
Django version: 1.9.13
django-otp version: 0.4.2
django-two-factor-auth version: 1.5.0 (latest for Django 1.9)
Expected Behavior
If
otp_yubikey
is installed in current environment (venv), but absent inINSTALLED_APPS
, then tests which use login should work.Current Behavior
Tests crash with:
Possible Solution
Instead of trying to import
otp_yubikey
and catchingImportError
you can check ifotp_yubikey
is present inINSTALLED_APPS
.Steps to Reproduce (for bugs)
Well, I don't have minimal example, but here is the change I am working (patchset 2 failed due to this problem). I have ran it locally and pasted the reason above. https://gerrit.sio2project.mimuw.edu.pl/#/c/2946/
Your Environment