13 Commits

Author SHA1 Message Date
Ben Sturmfels
9bf3bc1944 Remove remaining imports/calls to six not automatically removed by pyupgrade. 2021-03-05 23:42:38 +11:00
Ben Sturmfels
dec47c7102 Apply pyupgrade --py3-plus to remove Python 2 compatibility code. 2021-03-05 23:12:19 +11:00
Jessica Tallon
b4997540dc Fix some unit tests and bugs
This fixes a lot of the issues with the LocalUser changes that were
merged recently. There was a problem where the attributes of LocalUser
were not being eagerly loaded and because the Session was detached an
exception was being raised when they were accessed.

This also fixes some typo's which were introduced.

Finally this adds a temporary fix for a potential SQLAlchemy bug, this
is a bug where doing:

    User.query.filter(LocalUser.username == "some_username").first()

does NOT yeild a user with the username "some_username" but all users
on the site. The temp fix is to just query the LocalUser, this should
be resolved when bug is confirmed and fixed upstream.
2015-08-24 21:07:06 +02:00
Jessica Tallon
d88fcb03e2 Change codebase to query or create correct User model
The code base had many references to User.username and other
specific to LocalUser attributes as that was the way it use to exist.
This updates those to query on the generic User model but filtering
by attributes on the LocalUser.
2015-07-31 15:15:24 +02:00
Christopher Allan Webber
f6bad0eb26 Merge branch 'master' into merge-python3-port
Has some issues, will iteratively fix!

Conflicts:
	mediagoblin/gmg_commands/__init__.py
	mediagoblin/gmg_commands/deletemedia.py
	mediagoblin/gmg_commands/users.py
	mediagoblin/oauth/views.py
	mediagoblin/plugins/api/views.py
	mediagoblin/tests/test_api.py
	mediagoblin/tests/test_edit.py
	mediagoblin/tests/test_oauth1.py
	mediagoblin/tests/test_util.py
	mediagoblin/tools/mail.py
	mediagoblin/webfinger/views.py
	setup.py
2014-09-16 14:01:43 -05:00
Berker Peksag
9459fa3ced Fix tests on Python 3. 2014-07-14 05:49:38 +03:00
Christopher Allan Webber
a433775536 Wrapping things to not exceed column 80 in test_ldap 2014-07-10 10:24:37 -05:00
Berker Peksag
e49b7e02b2 Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
2014-06-02 20:59:28 +03:00
Berker Peksag
fd19da346b Use six.moves.urllib.parse instead of the urlparse module. 2014-05-26 19:52:18 +03:00
Christopher Allan Webber
515e3bd9af Fixing ALL THE BROKEN TESTS. I probably broke most of them.
- We've now broken out user.html and user_nonactive.html but the
   tests didn't reflect it
 - the location of one of the module imports broke, but I didn't
   notice because of .pyc files ;)

This commit sponsored by Tiberiu C. Turbureanu (ceata.org).
Thank you!
2013-09-29 10:41:43 -05:00
Christopher Allan Webber
692e22d10b Fixing one test post-merge. We got rid of the mongo stuff, so... consistency!
Now we can merge LDAP support!  Woohoo!

This commit sponsored by the ever-awesome GMG contributor, Sebastian
Spaeth.  Thanks!
2013-09-20 09:51:24 -05:00
Rodney Ewing
b1ac679592 skip test if python-ldap is not installed 2013-08-15 16:02:24 -07:00
Rodney Ewing
d68ada283b added tests for ldap plugin 2013-08-15 16:02:00 -07:00