aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_modelmethods.py
Commit message (Collapse)AuthorAgeFilesLines
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-051-50/+49
|
* Collection changes and migration for federationJessica Tallon2015-10-071-1/+1
| | | | | | | - Adds a "type" column to the Collection object and allows the CollectionItem model to contain any object. - Changes "items" to "num_items" as per TODO - Renames "uploader", "creator" and "user" to a common "actor" in most places
* Fix some unit tests and bugsJessica Tallon2015-08-241-2/+2
| | | | | | | | | | | | | | | | | | 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.
* Change codebase to query or create correct User modelJessica Tallon2015-07-311-4/+4
| | | | | | | 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.
* Fix some problems with activity mixins and migrationsJessica Tallon2015-05-261-52/+0
|
* Fix #984 - Improvements to Activity and ActivityIntermediatorJessica Tallon2014-10-211-2/+56
| | | | | | - Add unit tests to cover get and set methods on Activity - Rewrite the set to remove set and use Session.flush instead - Use sqlalchemy's validator instead of .save hack
* Merge branch 'master' into merge-python3-portChristopher Allan Webber2014-09-161-10/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix #923 - add allow_admin to user_has_privilege decoratorJessica Tallon2014-07-291-10/+7
| |
* | Fix tests on Python 3.Berker Peksag2014-07-141-2/+7
|/
* Issue #686: Create User.url_for_self() method.Berker Peksag2014-04-101-0/+24
| | | | | *Note from cwebber on merge of this branch:* Thanks also to Sturm who provided an early version of this patch.
* I've moved on to one of the last phases of my work! Now I'm just checking offtilly-Q2013-09-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | items from my last to-do list. The biggest change in this commit is that I made the moderation reports panel sortable via get request. I also added in page nu- mbers so that more than 10 reports can be viewed. I'm hoping to go from here to make a search page. Aside from that, there were only a few other changes I made this time. I fixed two bugs in my code. I copy-ed and pasted function mediagoblin.user_pages.views:media_preview_comment which I must've deleted ear- -lier in a merge. And I moved some of the javascript I was using in the modera- -tion templates into it's own seperate .js file. =============================================================================== Made the moderation reports panel view sortable =============================================================================== --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/moderation/user.html --| Made `<user> report history` into a link that automatically shows all open | and closed reports on <user>. =============================================================================== Grabbed some code from master that I accidentally deleted in a merge =============================================================================== --\ mediagoblin/user_pages/views.py =============================================================================== Moved javascript away from templates into its own file =============================================================================== --\ mediagoblin/static/js/setup_report_forms.js --\ mediagoblin/templates/mediagoblin/moderation/report.html --\ mediagoblin/templates/mediagoblin/moderation/user.html =============================================================================== Cleared trailing white space =============================================================================== --\ mediagoblin/templates/mediagoblin/moderation/media_panel.html --\ mediagoblin/moderation/tools.py --\ mediagoblin/templates/mediagoblin/meta/terms_of_service.html --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/user_pages/media.html --\ mediagoblin/tests/test_modelmethods.py =============================================================================== Small fixes =============================================================================== --\ mediagoblin/templates/mediagoblin/moderation/report.html --| Fixed a link so that it points to the correct user page --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Fixed a bug that crashed this page when a guest visitted it (because | request.user is None)
* pushing so paroneayea can help me resolve a conflict within the tests.tilly-Q2013-08-231-15/+13
|
* This was a very small update, I'm hoping to rebase after this to solve sometilly-Q2013-08-201-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | other problems. I started looking at the tests in this update. This update I spent fixing the tests to work with my new code. --\ mediagoblin/db/migration_tools.py --| Merging from ticket 679 --\ mediagoblin/db/migrations.py --| Added unique constraint to Privilege.privilege_name --\ mediagoblin/db/models.py --| Deleted vestigial Privilege.is_admin_or_moderator method --\ mediagoblin/templates/mediagoblin/moderation/user.html --| Add a `Ban User` / `UnBan User` for admin --\ mediagoblin/test/test_api.py --| Fixed test with my new changes --\ mediagoblin/test/test_auth.py --| Try to fix test, still having problems --\ mediagoblin/test/test_modelmethods.py --| Wrote my first test for the User.has_privilege method --\ mediagoblin/test/test_modelmethods.py --| Fixed test with my new changes --\ mediagoblin/test/test_sqlmigrations.py --| Merging from ticket 679 --\ mediagoblin/test/tools.py --| Editted add_fixture_user to allow for privileges rather than active column
* Reverting "Always activate testing in every test module ever."Christopher Allan Webber2013-05-171-5/+1
| | | | | | 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-1/+5
| | | | Kind of a dorky way to implement this, but...
* Really removing nosetests things now! all assert_whatever removedChristopher Allan Webber2013-04-061-3/+1
|
* Switch test_app generation over to use py.test fixtures.Christopher Allan Webber2013-04-041-37/+58
| | | | | | | | | | | | 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
* These tests need to have a MediaGoblin app setup so they can connect to the db!Christopher Allan Webber2013-04-031-0/+1
| | | | Thanks to py.test --boxed for helping discover that ;)
* All mediagoblin tests now pass with py.test (switched setUp to setup)Christopher Allan Webber2013-04-031-1/+1
|
* Some tests for media_data, yeah!Elrond2013-02-011-0/+17
| | | | | | | | One in the submissions, that posts a jpg with gps data. One in the modelmethods to test some behaviours. The later test fails. Fixes coming up.
* Fix reference of get_test_app->get_app in test_modelmethodsChristopher Allan Webber2013-01-251-2/+2
| | | | | (This changed in master while this test was being written; correcting post-merge.)
* New mediaentry slug tests now pass!Christopher Allan Webber2013-01-231-0/+130
- fixed some issues with "whacking uuid junk on the slug" - uuid4() -> uuid.uuid4() so that mock will work right - added all the tests!