Closed pbadeer closed 1 week ago
Merging #178 (13a2177) into main (cdc1602) will increase coverage by
0.10%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #178 +/- ##
==========================================
+ Coverage 92.95% 93.06% +0.10%
==========================================
Files 15 15
Lines 568 577 +9
==========================================
+ Hits 528 537 +9
Misses 40 40
Impacted Files | Coverage Δ | |
---|---|---|
allauth_2fa/adapter.py | 82.14% <100.00%> (ø) |
|
tests/test_allauth_2fa.py | 100.00% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Hi @pbadeer!
Thank you!
Can you maybe write a test case which can prove that this fixes your bug?
I can certainly try! I'm not well versed on pytest and I've never used Hatch so I'm struggling a bit, but I'll throw some time at it.
BTW I got 34 test failures (18 passes) with a new test environment due to:
FAILED tests/test_allauth_2fa.py::test_require_2fa_middleware[tests.adapter.CustomAdapter-True] - django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'django_extensions.templatetags...
When I changed the requirements-dev.txt line:
django-extensions==2.2.6
and removed the pin to look like this:
django-extensions
all tests passed.
One of the fuller stack traces, they're all the same error:
\\lib\\site-packages\\django_extensions\\templatetags\\__init__.py'>
def get_package_libraries(pkg):
"""
Recursively yield template tag libraries defined in submodules of a
package.
"""
for entry in walk_packages(pkg.__path__, pkg.__name__ + "."):
try:
module = import_module(entry[1])
except ImportError as e:
> raise InvalidTemplateLibrary(
"Invalid template library specified. ImportError raised when "
"trying to load '%s': %s" % (entry[1], e)
) from e
E django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'django_extensions.templatetags.widont': cannot import name 'force_text' from 'django.utils.encoding' (\lib\site-packages\django\utils\encoding.py)
\lib\site-packages\django\template\backends\django.py:130: InvalidTemplateLibrary
@valberg Test case added. Let me know if I screwed anything up, apologies in advance!
pre-commit.ci autofix
pre-commit.ci autofix
This PR would be great. I have the same problem and am waiting for a fix :sweat_smile:.
This PR would be great. I have the same problem and am waiting for a fix 😅.
Same here, we are waiting for this to push our code to production.
Ditto the above, I can confirm this fix has worked for us, so a merge and release would be great 👍 Thank you
pre-commit.ci autofix
Getting this error when submitting the change password form after opening a key-based password reset link.
AttributeError: 'PasswordResetFromKeyView' object has no attribute 'redirect_field_name'
I'm using an Adapter that combines the OTPAdapter from this library and InvitationsAdapter from django-invitations, so this issue may or may not be present for others, but the change adds a simple safety check.
Full stack trace: