aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_api.py
Commit message (Collapse)AuthorAgeFilesLines
* Apply pyupgrade --py36-plus.Ben Sturmfels2021-09-231-13/+13
| | | | This removes some 'u' prefixes and converts simple format() calls to f-strings.
* Fix tests on Debian 11.Ben Sturmfels2021-04-041-2/+11
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-051-19/+19
|
* Added tests for tags in image API objectRomain Porte2017-11-121-0/+14
|
* Fixed flake8 errors for tests/test_api.pyRomain Porte2017-11-111-16/+30
| | | | | | Since I am adding a test I also took time to fix all flake8 errors in this test file, since I may add more tests in there and I prefer to work on a coherent code base.
* Added tests for custom file name using APIRomain Porte2017-11-111-2/+30
| | | | | | | | This adds a new test and verify that the old test has the "unknown.<extension>" format. As funny as it seems, the "image/jpeg" Content-Type will generate a ".jpe" extension but I was expecting a more common ".jpg" extension. This may be a bug, but this is not the subject of this patch.
* Fix #5376 - Ensure links have correct IDJessica Tallon2016-03-011-1/+1
| | | | | | | This ensures that links to comments have the correct ID (the ID of the Comment object) as well as fixing deletion on reports and fixing a few other little things. I hope this fixes the #5376 issue, though cannot reproduce so unable to confirm.
* Fix #5408 - ignore non-int offset in api feedLoic Dachary2016-01-251-2/+44
| | | | | | | | | In the same fashion limit=BAD fallsback to the default value, fallback to zero when offset=WORSE. Also add test coverage verifying limit/offset do the right thing. Signed-off-by: Loic Dachary <loic@dachary.org>
* Added test for #5356 - Read someone else's feedJessica Tallon2015-11-241-2/+35
| | | | | | This adds a test and improves a previous test for the ability to read someone elses feed. Previously it was not possible however this has since been patched and this test checks for that.
* Comment changes for federationJessica Tallon2015-10-201-18/+11
| | | | | | | | | | | | | | This adds a new Comment link table that is used to link between some object and then the comment object, which can be more or less any object in Mediagoblin. The MediaComment has been renamed to TextComment as that more aptly describes what it is. There is migrations for these changes. There is also the conslidation of the Report tables into a single Report table, the same with the Notification objects. This is because both of them split out MediaEntry and Comment versions into their own polymorphic versions from a base, this is no longer a meaningful distinction as comments can be anything.
* Collection changes and migration for federationJessica Tallon2015-10-071-4/+3
| | | | | | | - 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 #1077 - Fix updating comment via API and add testJessica Tallon2014-12-161-0/+37
|
* Fix #1069 - Add deleting images and comments via delete activitiesJessica Tallon2014-12-151-0/+69
|
* Fix #1056 - Add flag to accept URLs without a trailing slashJessica Tallon2014-12-121-6/+6
|
* Fix #1025 - Make API IDs IRIsJessica Tallon2014-11-211-8/+11
|
* Last two issues related to the python 3 merge tests: fixed!Christopher Allan Webber2014-09-161-8/+8
| | | | | | | - Fix the "pulling the error out of excinfo" stuff for py3 - The u"" only gets embedded in the string on py2. This commit sponsored by Jeff Gibson. Thanks, Jeff! :)
* Annnnd another json decode fix for py3! On a roll with these!Christopher Allan Webber2014-09-161-1/+1
| | | | This commit sponsored by Ramana Kumar. Thanks!
* json.loads(request.body) => json.loads(response.body.decode()))Christopher Allan Webber2014-09-161-7/+7
| | | | | | This fixes python 3 stuff. This commit sponsored by James Reilly. Thanks, James!
* Import mock from unittest if on py3Christopher Allan Webber2014-09-161-1/+4
|
* Merge branch 'master' into merge-python3-portChristopher Allan Webber2014-09-161-52/+447
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Tidy up federation code and add tests to cover more of the APIsJessica Tallon2014-08-181-27/+91
| |
| * Add more security checks when updating objects and testsJessica Tallon2014-08-041-15/+92
| |
| * Fix some security concerns regrding inpersonation in federation code.Jessica Tallon2014-07-311-0/+80
| |
| * Fix #927 - Clean up federation code after Elrond's reviewJessica Tallon2014-07-301-36/+7
| | | | | | | | | | | | | | | | - Add json_error and use inplace of json_response where appropriate. - Add garbage_collection to config spec file. - Fix bugs in both garbage collection task and test - Handle /api/whoami when no user logged in and a test for such a case. - Validate ID is correct and user has comment privilege to comment.
| * Switch from slug to ID and clean up style to conform to PEP-8Jessica Tallon2014-07-221-8/+16
| |
| * Create test for garbage collectionJessica Tallon2014-07-221-4/+37
| |
| * Add test for API object endpointJessica Tallon2014-07-221-0/+29
| |
| * Add more tests for federation APIsJessica Tallon2014-07-221-34/+143
| |
| * Require uploader privileges to upload media to APIJessica Tallon2014-07-221-19/+24
| |
| * Remove unneeded oauth fixtures and add test for image submissionJessica Tallon2014-07-221-38/+80
| |
| * Adds the unit-tests for API and cleans up APIxray72242014-07-221-65/+42
| |
* | Fix another tests.Berker Peksag2014-08-071-3/+3
| | | | | | | | (forgot to commit earlier)
* | Fix tests on Python 3.Berker Peksag2014-07-141-2/+2
|/
* This commit was solely to remove unused imports in the code that I have writtentilly-Q2013-09-231-1/+0
|
* This was a very small update, I'm hoping to rebase after this to solve sometilly-Q2013-08-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+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/+3
| | | | Kind of a dorky way to implement this, but...
* Refactor test resources into new resources.pyElrond2013-04-171-16/+2
|
* Really removing nosetests things now! all assert_whatever removedChristopher Allan Webber2013-04-061-1/+0
|
* Switch test_app generation over to use py.test fixtures.Christopher Allan Webber2013-04-041-11/+14
| | | | | | | | | | | | 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
* All mediagoblin tests now pass with py.test (switched setUp to setup)Christopher Allan Webber2013-04-031-1/+1
|
* Rename get_test_app to get_app.Elrond2013-01-181-2/+2
| | | | | | | 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.
* Don't get a fresh app when not neededSebastian Spaeth2013-01-081-1/+1
| | | | | | | | These tests, don't need fresh databases, so don't discard and recreate the tables. This reduces test suite runtime on my laptop from 130 to 96 seconds. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix some unicode related issues in oauth and the api.Elrond2012-12-231-1/+1
| | | | Found using the previous commit.
* Added API testsJoar Wandborg2012-12-231-0/+104