Closed prasoon2211 closed 11 years ago
The earlier commit is useless. See the second commit for changes.
The patch looks good, and we can compress the commits into a single one later.
There's only one thing missing here: tests. I can handle those if you want, or I can help you handle them.
First, we'd need to fix the test failure seen at https://travis-ci.org/mozilla/django-browserid/jobs/4017949 by changing test_backend_verify
to expect None
instead of {}
for extra_params
.
Then, we should edit https://github.com/mozilla/django-browserid/blob/master/django_browserid/tests/test_auth.py with a few changes:
BrowserIDBackendTests.auth
to accept a browserid_extra
argument and pass it along to authenticate
.BrowserIDBackendTests
that passes some value for browserid_extra
and checks the verify
function to see if it received that value when called (this will require mock, which is used elsewhere in that file if you need an example).Normally I'd ask for documentation as well, but this feature isn't really official yet, as it was only used by addons.mozilla.org for some special functionality. It'll be mentioned in the changelog, though.
Let me know if you have more questions or just want me to handle the tests. Thanks!
I have not added the test. Please help me with that part.
Oh man, sorry for the late comment! Github seems to have failed to send me notifications for this thread. :(
pdb
doesn't work when running tests because the test runner captures all output (so if your test has some print
statements, for example, they aren't shown when running the test, unless there's an error, in which case the test runner displays the exception and all output from the test). Since pdb
requires user input and output, it just freezes.
An easy way around this is to install ipdb, a variant of pdb
that uses IPython as the interpreter. Not only is this more useful in general, ipdb
is able to be run in the middle of a test!
I'll also look at your code and see if I can spot the issue. :)
Beyond the issues I mentioned, this looks good! Fix them up and I'll squash and merge. Nice work!
Thank you for all you help. I was beginning to wonder why hadn't you replied but then I thought that you might just be busy. Anyway, tests seem to be working now. Thanks again!
Merged in bc284f7502fcd91cd9b102deb2b0c7407997b8f4, nice work! Thanks! :cake:
Added an optional keyword argument to
BrowserIDBackend.authenticate
, calledbrowserid_extra
that is passed toverify
asextra_params
instead of passing all the kwargs toverify
directly.Concerned code : Line 65, 77 of
auth.py