aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_auth.py
Commit message (Collapse)AuthorAgeFilesLines
* Reverting "Always activate testing in every test module ever."Christopher Allan Webber2013-05-171-4/+0
| | | | | | Revert "Always activate testing in every test module ever." This reverts commit 0536306048daa0970d2e43411ba2a9bf073e570e.
* Always activate testing in every test module ever.Christopher Allan Webber2013-05-161-0/+4
| | | | Kind of a dorky way to implement this, but...
* Really removing nosetests things now! all assert_whatever removedChristopher Allan Webber2013-04-061-27/+13
|
* Switch test_app generation over to use py.test fixtures.Christopher Allan Webber2013-04-041-4/+2
| | | | | | | | | | | | By doing this, we can take advantage of py.test's ability to create temporary directories that are then cleaned up later during testing. This helps for sandboxing things. This also involves a ton of changes: - Changing the get_app stuff appropriately, getting rid of the setup_fresh_app decorator - Making said fixture - Switching over a billion tests to use it
* Better Py3 compat: d.has_key(k) -> k in dElrond2013-01-301-21/+10
| | | | | | | | py3 does not have dict.has_key any more. You have to use "key in dict" instead. As that works in python2 as well, let's use that. Also some small bits of pep8.
* Restructure ForgotPassword viewSebastian Spaeth2013-01-211-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Remove mongo limitations (no 'or' when querying for either username or email). 2) Lost password function revealed if an user name or email address is registered, which can be considered a data leak. Leaking user names is OK, they are public anyway, but don't reveal lookup success in case the lookup happened by email address. Simply respond: "If you have an account here, we have send you your email"? 3) username and email search was case sensitive. Made username search case insensitive (they are always stored lowercase in the db). Keep email-address search case sensitive for now. This might need further discussion 4) Remove a whole bunch of indention in the style of: if no error: ... if no error: ... if no error: actually do something in the regular case by restructuring the function. 5) Outsource the sanity checking for username and email fields into the validator function. This way, we get automatic case sanity checking and sanitizing for all required fields. 6) Require 5-char password and fix tests Originally, the Change password form required a password between 6-30 chars while the registration and login form did not require anything special. This commit introduces a common minimum limit for all forms which breaks the test suite which uses a 5 char password by default. :-). As 5 chars seem sensible enough to enforce (people should be picking much longer ones anyway), just reduce the limit to 5 chars, thereby making all tests pass. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Rename get_test_app to get_app.Elrond2013-01-181-5/+5
| | | | | | | nosetests runs everything that even vaguely looks like a test case... even our get_test_app. And as it is imported everywhere... it is run everywhere as a test case. Renaming it saves us about 10+ tests and a few seconds of time.
* tests: More instances where a fresh database is not neededSebastian Spaeth2013-01-081-5/+5
| | | | Save test runtime by not dumping the databases when not needed.
* Move db.sql.models* to db.models*Sebastian Spaeth2013-01-071-1/+1
|
* tests/auth: Don't rely on case sensitive error stringsSebastian Spaeth2012-12-211-2/+2
| | | | | | | | | | webob's 404 status is "404 NOT FOUND" while werkzeug's is "404 Not Found". Our test suite was checking the upper case string for equality. Just test the status error code "404" rather than the full string which might change at some points/versions and should not need to be tested. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move DBModel._id -> DBModel.idSebastian Spaeth2012-12-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | We were refering to model._id in most of the code base as this is what Mongo uses. However, each use of _id required a) fixup of queries: e.g. what we did in our find() and find_one() functions moving all '_id' to 'id'. It also required using AliasFields to make the ._id attribute available. This all means lots of superfluous fixing and transitioning in a SQL world. It will also not work in the long run. Much newer code already refers to the objects by model.id (e.g. in the oauth plugin), which will break with Mongo. So let's be honest, rip out the _id mongoism and live with .id as the one canonical way to address objects. This commit modifies all users and providers of model._id to use model.id instead. This patch works with or without Mongo removed first, but will break Mongo usage (even more than before) I have not bothered to fixup db.mongo.* and db.sql.convert (which converts from Mongo to SQL) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix up testsSebastian Spaeth2012-12-211-2/+3
| | | | | | | | | | | | empty find() queries would not work anymore with the simplified .find compatability code, so remove these and use proper sqlalchemy in the tests. The storage test failed because my virtualenv environment ran mediagoblin/local/mediagoblin/tests/test_storage.py and somehow decided the 2 classes are different objects. Just test against the full class name. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Prevent SQLAlchemy non-Unicode warnings from this test.Brett Smith2012-07-081-8/+8
|
* Reload the user for current values.Elrond2012-03-261-0/+1
| | | | This might not be needed, but it helped at one point.
* It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
|
* Fix unit tests for new forget password flowElrond2012-01-011-1/+1
| | | | | | | | After changing the password, the login page is now shown. It contains a message. (we can't test for that easily currently. There is a bug open on this problem.) At least for the login page being shown now.
* Fixed submission error handling and broken testsJoar Wandborg2011-12-311-2/+2
| | | | | | - Fixed broken test_auth test - Fixed error handling on submission, it now raises the exception if it is not explicitly relevant to file submission.
* Fixed broken confirm_password testJoar Wandborg2011-12-301-17/+0
|
* Dot-Notation for Users.fp_token_expireElrond2011-12-051-4/+4
|
* Dot-Notation for Users.fp_verification_keyElrond2011-12-051-1/+1
|
* Dot-Notation for Users.verification_keyElrond2011-12-051-1/+1
|
* Dot-Notation for Users.statusElrond2011-12-051-3/+3
|
* Dot-Notation for Users.email_verifiedElrond2011-12-051-3/+3
|
* Merge branch 'misc/fixture_add_user'Elrond2011-12-041-6/+2
|\ | | | | | | | | * misc/fixture_add_user: fixture_add_user: Factoring a unit test tool
| * fixture_add_user: Factoring a unit test toolElrond2011-12-011-6/+2
| | | | | | | | | | | | | | Some unit tests need a user in the database, especially to act as that user. Some routines did that on their own. So factored this whole thing into a new function and use it around.
* | Expect 404 in unit tests, if we now use 404.Elrond2011-12-021-4/+4
|/ | | | | | | | Our unit tests for auth were expecting a 400. Well, now we give a 404. So expect that! I'm not completely sure, if the 404 is the right thing here, but that's another topic.
* Dot-Notation for "_id"Elrond2011-11-151-6/+6
| | | | | | | | | Note: Migrations can't use "Dot Notation"! Migrations run on pymongo, not mongokit. So they can't use the "Dot Notation". This isn't really a big issue, as migrations are anyway quite mongo specific.
* Finished splitting util.py into separate files.Aaron Williamson2011-10-011-5/+5
|
* Moved common, translation, template, and url code out of util.py and into ↵Aaron Williamson2011-10-011-53/+53
| | | | tools/[file].py
* Merge branch 'gullydwarf-cfdv-f357_lost_password_functionality'Christopher Allan Webber2011-09-081-0/+88
|\ | | | | | | | | Conflicts: mediagoblin/auth/routing.py
| * Updating calls to recall password URLs to respect changed routingChristopher Allan Webber2011-09-071-6/+8
| |
| * for readability, and adds unit test for expired tokenCaleb Forbes Davis V2011-09-051-0/+10
| |
| * added unit tests for lost password codeCaleb Forbes Davis V2011-09-051-0/+76
| |
* | 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|/
* Updating tests to reflect we redirect to the user's page after verification now.Christopher Allan Webber2011-08-011-4/+8
|
* Log in user after regitrationChristopher Allan Webber2011-07-291-0/+5
|
* Redirect to the user's profile after registrationChristopher Allan Webber2011-07-291-2/+2
| | | | | | | - Updated the view - Updated the tests - Fixed a weirdness in the registration view where the 'user' variable used to be called 'entry'
* allows using messaging instead of verify_email.html to pass testsCaleb Forbes Davis V2011-07-041-2/+2
| | | | | * re-instated verification_successful flag * modified test_auth to verify nav to user_pages/user.html template
* added test coverage for redirecting after login with the next paramChris Moylan2011-06-191-2/+12
|
* Added tests for all sorts of login form abuse.Chris Moylan2011-06-191-6/+76
| | | | Added tests for log out
* logins are now somewhat testedChris Moylan2011-06-171-5/+43
|
* mediagoblin.globals->mediagoblin.mg_globalsChristopher Allan Webber2011-06-121-5/+5
|
* A setup_fresh_app decorator which should make writing tests a bit easier.Christopher Allan Webber2011-06-061-5/+3
| | | | Setting test_register_views() to use it also.
* Docstring for test_register_views()Christopher Allan Webber2011-06-051-0/+3
|
* Make sure that two users with the same username can't register.Christopher Allan Webber2011-06-051-1/+14
|
* Email verification view test worksChristopher Allan Webber2011-06-051-1/+25
|
* Make sure we can register, and then that we get the verification emailChristopher Allan Webber2011-06-051-4/+46
|
* Just a bit of formatting for these unfinished tests ;)Christopher Allan Webber2011-06-051-2/+4
|
* Test registration form integrityChristopher Allan Webber2011-06-051-0/+64
|
* The first bit of the registration tests working. Not fully there, butChristopher Allan Webber2011-06-051-0/+26
| | | | | it's clear that the webtest part is working, without having tested the database yet. :)