aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_submission.py
Commit message (Collapse)AuthorAgeFilesLines
* Apply pyupgrade --py36-plus.Ben Sturmfels2021-09-231-7/+7
| | | | This removes some 'u' prefixes and converts simple format() calls to f-strings.
* Remove remaining Python 2 compatibility code.Ben Sturmfels2021-03-051-5/+0
|
* Remove remaining imports/calls to six not automatically removed by pyupgrade.Ben Sturmfels2021-03-051-8/+1
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-051-67/+67
|
* Fixes for small bugsBoris Bobrov2018-07-121-3/+6
| | | | | There were some blocking issues in the code. They are small, but break tests and/or production. Fixed some of them.
* Change complimentary_task to complementary_tasvijeth-aradhya2017-08-291-4/+4
| | | | Closes #11
* Create a seperate test for get_all_mediavijeth-aradhya2017-08-171-3/+24
|
* Add test for get_all_media()vijeth-aradhya2017-08-161-1/+20
| | | | Check for it's returned values.
* Test whether video is transcoded to all resolutionsvijeth-aradhya2017-06-251-3/+11
| | | | | | After `self.check_normal_upload`, query the database and check whether the video got transcoded to all the required resolutions.
* Test accepted_files and accepted_resolutionsvijeth-aradhya2017-06-251-1/+10
|
* Add test_chord for TestSubmissionVideovijeth-aradhya2017-06-251-8/+74
| | | | | Testing the arguments passed to celery.chord when a video is submitted.
* Add VideoProcessingManager.workflow() testsvijeth-aradhya2017-06-251-0/+69
| | | | Testing workflow method including its return data.
* Remove requirement that audio/video dependencies must be installed for testsChristopher Allan Webber2016-03-181-61/+145
| | | | | | | Some tests were added for running audio and video submission tests in test_submission.py. Unfortunately these were not skipped if these dependencies were not installed. This patch attempts to fix that while leaving the tests intact.
* Issue #5349: Submission tests fail confusingly on missing dependencyChristopher Allan Webber2016-02-041-0/+21
| | | | | They gave a DetachedInstanceError, despite being totally unrelated to anything in database-land!
* Add test to check that an activity is created when a collection was chosen.tom2016-01-071-4/+11
|
* Add collection drop down to submit page.tom2016-01-071-1/+59
|
* Comment changes for federationJessica Tallon2015-10-201-2/+8
| | | | | | | | | | | | | | 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.
* Add public_id fixes throughout the codeJessica Tallon2015-10-071-0/+10
| | | | | | | | This adds several things, mainly code which checks for the public id and if it doesn't exist generating it where it can. This is to because we need to keep the public_id to be able to effectively soft delete models. This also adds a public_id field to the Activity along with a migration.
* Fix some unit tests and bugsJessica Tallon2015-08-241-1/+1
| | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | 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.
* added a/v submission testingBoris Bobrov2015-02-161-0/+19
|
* Merge branch 'location'Jessica Tallon2014-10-091-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Add Location model which holds textual, geolocation coordiantes or postal addresses. This migrates data off Image model metadata onto the general Location model. It also adds the ability for location to be set on MediaEntry, User, MediaComment and Collection models. The geolocation plugin has been updated so that the location can be displayed in more general places rather than explicitely on the MediaEntry view. If GPS coordiantes are set for the User the profile page will also have the OSM provided by the geolocation plugin.
| * Add location model and migrationsJessica Tallon2014-10-091-1/+1
| |
* | pdf tests: use our own pdf doc as GOOD_PDFAlon Levy2014-09-261-1/+1
| | | | | | | | remove non distributable good.pdf
* | Fix tests on Python 3.Berker Peksag2014-07-141-4/+6
| |
* | Use six.text_type instead of unicode().Berker Peksag2014-06-021-1/+2
| | | | | | | | I will be switch to use ``from __future__ import unicode_literals`` later.
* | Use six.moves.urllib.parse instead of the urlparse module.Berker Peksag2014-05-261-1/+2
|/
* Fixing issues in the tests caused by the OPW-Moderation-Update mergeChristopher Allan Webber2013-10-081-45/+17
| | | | | | | | | Not that branch's fault! Just both that branch and master had both done a lot of changes to overlapping code. self.test_user switched to self.our_user(). Updating everywhere. This commit sponsored by Sam Kleinman. Thank you! :)
* Merge remote-tracking branch 'refs/remotes/tilly-q/OPW-Moderation-Update'Christopher Allan Webber2013-10-071-10/+20
|\ | | | | | | | | | | | | Conflicts: mediagoblin/templates/mediagoblin/user_pages/user.html mediagoblin/tests/test_auth.py mediagoblin/tests/test_submission.py
| * This commit was solely to remove unused imports in the code that I have writtentilly-Q2013-09-231-1/+1
| |
| * I did some more code-keeping in this commit. I added a lot of documentation, sotilly-Q2013-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that most of my functions do indeed have effective docstrings. I also changed the decorators so that they imply eachother in a logical way. I also modified the one decorator get_media_comment_by_id to be more usable with the variable urls of mediagoblin.user_pages.views:file_a_report. I also noticed a few tests had broken, so I went through them and fixed them up, finding that mostly there were problems in my actual writing of the tests. I also did a few other small tasks such as creating a new User method to check whether or not a User is ban- -ned. =============================================================================== Added in documentation =============================================================================== --\ mediagoblin/db/models.py --\ mediagoblin/decorators.py --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/user_pages/lib.py =============================================================================== Rearranged decorators to be more efficient =============================================================================== --\ mediagoblin/decorators.py --| Made it so that user_not_banned is encapsulated in require_active_login --| Made it so that require_active_login is encapsulated in user_has_privilege --| Changed get_media_comment_by_id into get_optional_media_comment_by_id. It | now returns valid code if the MediaComment id is absent. This makes it pos- | -sible to use this decorator for the function: | mediagoblin.user_pages.views:file_a_report --\ mediagoblin/user_pages/views.py --| Replaced the mediagoblin.user_pages.views:file_a_comment_report with the | decorator mentioned above --\ mediagoblin/user_pages/routing.py ----------------------------------------------------------- | took out unnecessary @user_not_banned decorators | ----------------------------------------------------------- --\ mediagoblin/submit/views.py --\ mediagoblin/user_pages/views.py =============================================================================== Fixed broken tests =============================================================================== --\ mediagoblin/tests/test_auth.py --\ mediagoblin/tests/test_privileges.py --\ mediagoblin/tests/test_submission.py =============================================================================== Fixed broken code =============================================================================== --\ mediagoblin/tools/response.py =============================================================================== Other Tasks =============================================================================== --\ mediagoblin/db/models.py --| Added in User.is_banned() method --\ mediagoblin/decorators.py --| Utitilized User.is_banned() method in the user_not_banned decorator --\ mediagoblin/moderation/views.py --| Made it impossible for an admin to ban themself. --| Got rid of a vestigial print statement --\ mediagoblin/templates/mediagoblin/base.html --| Made it so the top panel does not show up for users that are banned. --\ mediagoblin/templates/mediagoblin/moderation/user.html --| Rearranged the javascript slightly ===============================================================================
| * This was a big commit! I included lots of documentation below, but generally Itilly-Q2013-08-291-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | did a few things. I wrote many many many new tests, either in old test files or in the three new test files I made. I also did some code-keeping work, deleting trailing whitespace and deleting vestigial code. Lastly, I fixed the parts of the code which I realized were broken thru the process of running tests. =============================================================================== Deleted trailing whitespace: =============================================================================== --\ mediagoblin/decorators.py --\ mediagoblin/auth/tools.py --\ mediagoblin/db/migrations.py --\ mediagoblin/db/models.py --\ mediagoblin/gmg_commands/users.py --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/media_panel.html --\ mediagoblin/templates/mediagoblin/moderation/report.html --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/moderation/user.html --\ mediagoblin/templates/mediagoblin/moderation/user_panel.html --\ mediagoblin/templates/mediagoblin/user_pages/report.html --\ mediagoblin/templates/mediagoblin/utils/report.html --\ mediagoblin/user_pages/lib.py --\ mediagoblin/user_pages/views.py =============================================================================== Deleted Vestigial Code =============================================================================== --\ mediagoblin/db/util.py --\ mediagoblin/tests/test_notifications.py =============================================================================== Modified the Code: =============================================================================== --\ mediagoblin/moderation/tools.py --| Encapsulated the code around giving/taking away privileges into two | funtions. --\ mediagoblin/moderation/views.py --| Imported and used the give/take away privilege functions --| Replaced 'require_admin_or_moderator_login' with |'user_has_privilege(u"admin")' for adding/taking away privileges, only | admins are allowed to do this. --\ mediagoblin/templates/mediagoblin/banned.html --| Added relevant translation tags --| Added ability to display indefinite banning --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Made sure the add comments button was only visible for users with the | `commenter` privilege --\ mediagoblin/tests/test_submission.py --| Paroneayea fixed a DetachedInstanceError I was having with the our_user | function --\ mediagoblin/tests/tools.py --| Added a fixture_add_comment_report function for testing. --\ mediagoblin/tools/response.py --| Fixed a minor error where a necessary return statement was missing --| Fit the code within 80 columns --\ mediagoblin/user_pages/views.py --| Added a necessary decorator to ensure that only users with the 'commenter' | privilege can post comments =============================================================================== Wrote new tests for an old test file: =============================================================================== --\ mediagoblin/tests/test_auth.py --| Added a new test to make sure privilege granting on registration happens | correctly --\ mediagoblin/tests/test_modelmethods.py* --| Added a test to ensure the User method has_privilege works properly =============================================================================== Wrote entirely new files full of tests: =============================================================================== --\ mediagoblin/tests/test_moderation.py --\ mediagoblin/tests/test_privileges.py --\ mediagoblin/tests/test_reporting.py =============================================================================== =============================================================================== NOTE: Any files I've marked with a * in this commit report, were actually subm- itted in my last commit. I made that committ to fix an error I was having, so they weren't properly documented in that report. =============================================================================== ===============================================================================
| * pushing so paroneayea can help me resolve a conflict within the tests.tilly-Q2013-08-231-3/+3
| |
| * This commit was just to fix a few of the errors with the merging and totilly-Q2013-08-201-1/+1
| | | | | | | | make sure that all of the previous tests work fine.
* | added testsRodney Ewing2013-08-261-8/+8
| |
* | fixed tests and defaultsRodney Ewing2013-08-261-0/+8
| |
* | fixed testsRodney Ewing2013-08-261-8/+0
| |
* | fixed tests and defaultsRodney Ewing2013-08-261-0/+8
| |
* | fixed tests and defaultsRodney Ewing2013-08-261-6/+40
| |
* | added testsRodney Ewing2013-08-261-1/+67
|/
* Merge branch 'rodney757-media_plugins'Christopher Allan Webber2013-07-121-2/+2
|\ | | | | | | | | | | Conflicts: mediagoblin.ini mediagoblin/tests/test_mgoblin_app.ini
| * Switch the import of the image media manager over to the new classChristopher Allan Webber2013-07-121-2/+2
| | | | | | | | | | | | | | This helps resolve one of the remaining issues with the tests for the media type pluginification. This commit sponsored by Jeffrey Moe. Thanks Jeff! Lulzbot rocks!
* | Patch by Strum. Ticket #451 - Convert all mongokit style .find, .find_one, ↵Rodney Ewing2013-07-111-5/+5
|/ | | | .one calls over to SQLAlchemy queries
* Reverting "Always activate testing in every test module ever."Christopher Allan Webber2013-05-171-5/+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/+5
| | | | Kind of a dorky way to implement this, but...
* image resizing: Refactor some decisions into resize_tool.Elrond2013-04-271-1/+1
| | | | | | | Loading the thumb/medium sizes from the config, saving things to the db, and loading the image is now all done by resize_tool. It still calls resize_image for the actual work.
* at pytest author's advice, changing the way _setup back to -> setupChristopher Allan Webber2013-04-181-37/+15
| | | | | They showed me how to use @pytest.fixture, which allowed us to pass the test into setup!
* Turning image's media manager into a new style class.Elrond2013-04-171-1/+1
| | | | | images are the first media type to use the new style class based media manager.
* First step towards a MediaManager class: Compat one.Elrond2013-04-171-1/+2
| | | | | | To get us moving towards a MediaManager class, the first idea is to create a class that wraps our current dict based manager and makes all users happy.
* Refactor test resources into new resources.pyElrond2013-04-171-15/+2
|