Opened 14 years ago
Last modified 13 years ago
#80 closed defect (FIXED)
Test submission views
Reported by: | Christopher Allan Webber | Owned by: | Christopher Allan Webber |
---|---|---|---|
Priority: | minor | Milestone: | 0.0.4 |
Component: | programming | Keywords: | |
Cc: | Parent Tickets: |
Description
Submission views, also untested, time to test them!
Change History (17)
comment:2 by , 14 years ago
I was looking at this ticket earlier. Seems easy enough. Are we testing the actual upload process in addition to form submission?
comment:3 by , 14 years ago
Status: | New → In Progress |
---|
comment:3 by , 14 years ago
We should test the upload process as in terms of "does this file hit the queue\_store and is it registered as such in the database". We don't need to test the "processing" step that gets handed off to celery. Thanks so much for working on this!
comment:4 by , 13 years ago
I've fallen a little behind on this because I had a busy weekend and I started a Minecraft server. I think I've wrapped my head around testing file uploads in Nose so this should come together fairly quickly now.
comment:5 by , 13 years ago
Good to know... thanks for the update. If you get stuck, ping me on IRC.
comment:7 by , 13 years ago
I think I've got a good start. [https://gitorious.org/\ :sub:`cmoylan/mediagoblin/cmoylan-mediagoblin/commits/test\_submission\_views\_365](https://gitorious.org/`\ cmoylan/mediagoblin/cmoylan-mediagoblin/commits/test\_submission\_views\_365) All tests pass except for the malicious files with .jpg and .png extensions. When I try to upload my malicious files I get an internal server error. The malicious files I'm using are just copies of the 'ls' binary with .jpg and .png extensions. Could use a quick dev review.
comment:8 by , 13 years ago
So this looks good to me! A few requests then it's mergable: - Instead of doing things with getcwd(), could you instead use pkg\_resources? It's not hard, here's how to do it: GOOD\_JPG = pkg\_resources.resource\_filename( 'mediagoblin.tests', 'test\_submission/good.jpg') This uses the actual python packaging to do things. - Don't worry about the submitting bad filenames with the same extension because I think we need to complete `http://bugs.foocorp.net/issues/324 <http://bugs.foocorp.net/issues/324>`_ before we can do anything about that :( ... (I also think in the future these errors in will be caught in the processing stage) your tests look good though, for now please comment them out instead of removing them with a reference to us not handling this right. - We've switched it so you redirect to the user's homepage post-successful-submission... accomodate that. (We should probably test for a message inserted into the messaging framework but there's no way to do that... for now just check that we go to the user's homepage.) Looking good... thanks so much for this!
comment:9 by , 13 years ago
Excellent. I will implement the changes and report back. Thanks for the feedback!
comment:11 by , 13 years ago
[https://gitorious.org/\ :sub:`cmoylan/mediagoblin/cmoylan-mediagoblin/commits/test\_submission\_views\_365](https://gitorious.org/`\ cmoylan/mediagoblin/cmoylan-mediagoblin/commits/test\_submission\_views\_365) - Switched to pkg\_resources - Asserted redirect to user page after upload - Commented out "invalid file with valid extension" tests Requesting pull.
comment:12 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | In Progress → Resolved |
- Merging in master again to keep the branch up to date - Assigning to cwebber so it's on your radar
comment:13 by , 13 years ago
Thanks Chris Moylan, I'm working on getting the migrations stuff merged, then I'll try to tackle this next. Erk!
comment:14 by , 13 years ago
Status: | Resolved → Feedback |
---|
comment:15 by , 13 years ago
The original url for this bug was http://bugs.foocorp.net/issues/365 .
Relations:
#23: blocked
Note:
See TracTickets
for help on using tickets.