aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | issue 355: Only run tests in mediagoblin/tests/Elrond2013-01-111-1/+26
| | | | | | | | | | | | | | | | | | | | | If you don't give an option argument (starting with a dash) to runtests.sh then it will append the directory with all the tests to the commandline of nosetests. That way it will only search there for tests.
* | | Improve and extend profile editing testsSebastian Spaeth2013-01-091-76/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only ever ran the password changing test here, and not the half-existing test for changing the bio and homepage. Fix the tests to actually run both tests. We check that setting bio and homepage to a valid value works as expected. We also test for invalid bio (too long) and invalid URLs setting fails. (which is what we want). - Check that the old /edit/profile/ address redirects to /u/USER/edit/. - Check that /u/USER/edit/ works as expected - Check that /u/OTHERUSER/edit/ fails with a 403 Forbidden error when we are not logged in as that user. The last remaining test that would be useful is to make a user an admin and make sure the admin can edit other users' profiles. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Enable /u/USERNAME/edit/ pattern #588Sebastian Spaeth2013-01-094-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | Transition from the inconsistent /edit/profile/?username=FOO to the nicer /u/FOO/edit/. The old pattern will still work and redirects to the new URL. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Fix tests on webtest < 1.3.6.Elrond2013-01-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debian testing ships webtest 1.3.4. And it would be nice to use the base packages. One of the csrf tests fails on webtest < 1.3.6. But using a fresh app fixes it. We have no clue, why exactly. When we require webtest 1.3.6, change this.
* | | Move db.sql.migration_tools to db.migration_tools.Elrond2013-01-085-4/+4
| | | | | | | | | | | | Follow the new trend.
* | | Add inspect_table.Elrond2013-01-082-7/+11
| | | | | | | | | | | | | | | | | | In our current scheme of migrations, we reflect the current sql schema into an SQLAlchemy schema. So let's have a tool function for this.
* | | Move all the migration tools into new migration_tools.pyElrond2013-01-086-253/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | Factor all the migration related stuff out into a new .db.sql.migration_tools. First we don't have to load this module for our normal server. Second it makes all the import dependencies a little more cleaner.
* | | Fixing import to mediagoblin.db.base in stl modelsChristopher Allan Webber2013-01-081-1/+1
| | | | | | | | | | | | | | | Previously we had mediagoblin.db.sql.base, that just changed to drop the sql; fixing.
* | | Merge branch 'WIP/test_performance'Sebastian Spaeth2013-01-0810-48/+43
|\ \ \ | |/ / |/| |
| * | tests: More instances where a fresh database is not neededSebastian Spaeth2013-01-085-31/+27
| | | | | | | | | | | | Save test runtime by not dumping the databases when not needed.
| * | Don't get a fresh app when not neededSebastian Spaeth2013-01-084-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Do not fail is a user exists alreadySebastian Spaeth2013-01-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the tests want to create a new user, don't fail if it already exists and just reuse the existing one. This allows us to run tests without dumping the whole database if that is not needed for the tests. The upcoming tests for test_edit will make use of this. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Don't read full image media into RAM on copying (#419)Sebastian Spaeth2013-01-081-10/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | We copy uploaded media from the queue store to the local workbench and then to its final destination. The latter was done by simply: dst.write(src.read()) which is of course evil as it reads the whole file content into RAM. Which *might* arguably still be OK for images, but you never know. Make use of the provided storage() methods that offer chunked copying rather than opening and fudging with files ourselves. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Fix slug lookup regression (#587)Sebastian Spaeth2013-01-081-17/+21
| | | | | | | | | | | | | | | | | | | | | | Removing the Mongo InvalidID legacy code removed an explicit check for "int" for the id lookup. This led the @get_user_media_entry decorator to fail if we looked up a nonexisting non-numerical slug (it tried to query the id with a string, which failed). Cast id to int and return 404 in case it is non-numeric which fixes the regression. It does not fix the underlying problem of slug_or_id lookups that were discussed. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Made the airy header element responsive againJoar Wandborg2013-01-071-0/+6
| |
* | Remove custom GMQuery classSebastian Spaeth2013-01-072-15/+2
| | | | | | | | | | | | | | | | | | We provided a custom GMQuery class that offered a .sort() method for compatibility with the Mongo syntax. Now that we have settled for sqlalchemy which uses the order_by() method, we can safely remove this custom class and move a little closer to "pure" and native sqlalchemy usage. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Mv db.sql.base to db.baseSebastian Spaeth2013-01-0713-29/+11
| | | | | | | | | | | | | | | | This concludes the db.sql.* -> db.* move. Our db abstraction layer is sqlalchemy, so there is no need to a separate db.sql.* hierarchy. All tests have been run for each of the commit series to make sure everything works at every step.
* | Move mediagoblin.db.sql.extratypes to mediagoblin.db.extratypesSebastian Spaeth2013-01-074-3/+3
| | | | | | | | No other functional changes.
* | Move db.sql.models* to db.models*Sebastian Spaeth2013-01-0719-18/+21
| |
* | Move db.sql.util to db.utilSebastian Spaeth2013-01-076-334/+313
| | | | | | | | | | | | | | | | Now that sqlalchemy is providing the database abstractions, there is no need to hide everything in db.sql. sub-modules. It complicates the code and provides a futher layer of indirection. Move the db.sql.util.py to db.util.py and adapt the importers.
* | Remove mediagoblin.db.sql.fake.DESCENDINGSebastian Spaeth2013-01-077-52/+17
| | | | | | | | | | | | | | | | This is the last remnant that requires us to keep db.sql.fake.py. Use ModelName.desc() or sqlalchemy.sql.expression.desc(column) to achieve descending sorts. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Also make slug unit test work with the new optionally-translitcodec-free codeChristopher Allan Webber2013-01-061-7/+7
| |
* | Make translitcodec optional, and work nicely without it.Christopher Allan Webber2013-01-062-4/+14
| |
* | Made api_test use @require_active_loginJoar Wandborg2013-01-021-3/+1
| |
* | prepare_queue_task: Take app not request.Elrond2012-12-263-7/+10
| | | | | | | | | | | | | | | | | | First rename prepare_entry to prepare_queue_task, because this is really more like what this thing does. Thanks to Velmont for noting that we do not need a request in here, but an "app" is good enough. Which means, that this stuff can be called from tool scripts too.
* | upload refactor: Use prepare_entry in api.Elrond2012-12-261-18/+2
| |
* | Use run_process_media in the api.Elrond2012-12-261-20/+2
| | | | | | | | Now refactor in the api. Start with run_process_media.
* | Processing: Factor out prepare_entry.Elrond2012-12-262-25/+31
| | | | | | | | | | prepare_entry handles the task_id setup and generating a queue filename and file. it returns the queue file.
* | Factor out the actual calling of the processing.Elrond2012-12-262-21/+26
| | | | | | | | | | | | Calling the processing task and handling the exceptions is easy, but has a bunch of caveats, so factor it out into an easy callable function.
* | upload refactor: push url handlingElrond2012-12-262-26/+52
| | | | | | | | | | | | Start to refactor our upload handling in main submit and the api. Start factoring out the handling of PuSH url handling.
* | Bug #584, upgrade EXIF.py from master to read Nikon dataOdin Hørthe Omdal2012-12-262-16/+127
| |
* | Fix up symlinks in exif bumpSebastian Spaeth2012-12-263-1821/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous exif bump copied the newer version into mediagoblin/tools/extlib/exif but not in extlib/exif. Fix this by bumping extlib/exif and symlinking to tools/extlib/exif. Do note that this is still the version fetched from http://sourceforge.net/projects/exif-py/ while the upstream maintainer seems to be active on: https://github.com/ianare/exif-py (The sf.net download is quite new though) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Remove ObjectId from the treeSebastian Spaeth2012-12-257-29/+17
| | | | | | | | | | | | | | This was one of the last remaining Mongo holdouts and has been removed from the tree herewith. Good bye, ObjectId. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Remove temporary emacs files that have slipped inSebastian Spaeth2012-12-252-275/+0
| | | | | | | | Thanks Elrond for hilighting this :-)
* | Remove InvalidIdSebastian Spaeth2012-12-254-30/+8
| | | | | | | | | | | | It was a NoOp in our Non-mongo world. So it is safe to remove. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Move db.sql.migrations to db.migrationsSebastian Spaeth2012-12-252-1/+1
| |
* | Move db.sql.open to db.openSebastian Spaeth2012-12-254-83/+64
| | | | | | | | | | | | Now that mongo has been ripped out and sqlalchemy is already providing the database abstraction, there is no need to hide everything in the sql module. Transition db.sql.open to db.open and adapt all direct importers.
* | RIP out mongoSebastian Spaeth2012-12-2525-1536/+18
| | | | | | | | | | | | | | | | | | Since sqlalchemy is providing our database abstraction and we have moved away from Mongo as the underlying database, it is now time to simplify things and rip out mongo. This provides the bulk of the changes, and can stand on its own. There are some followup tasks that can be done, such as removing now unneeded abstraction layers, e.g. db.sql.fake.py
* | Update extlib/EXIFSebastian Spaeth2012-12-256-18/+2196
| | | | | | | | | | | | | | | | | | | | | | | | Bump bundled EXIF lib to 1.0.10 as release in Sep 2012. Also skip unused detailed EXIF tags for reading, we might turn that on when we need them. Adapt test to wording change in EXIF Flas field and due to the fact that we use "details=False" by default now (we did not use these anyway) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Merge branch '512_bump_video_js'Sebastian Spaeth2012-12-2512-4224/+191
|\ \
| * | Bump bundled video.js to v3.2.3 (#512)Sebastian Spaeth2012-12-2512-4224/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is nothing inherently wrong with the currently bundled version, but the last one was uploaded in March 2012 and there have been upstream releases since. So bump to the latest available release 3.2.3. Might help with the reported issue 512 of an unresponsive video player. Do note that the Flash fallback option is removed. If we decide this should be added it is easy to add it back. We still use our own customized theme. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | makeadmin and changepasswd had swapped help textChristopher Allan Webber2012-12-251-2/+2
| | |
| * | Try ipython-based shell first, falling back to plain shellSebastian Spaeth2012-12-191-9/+8
| | | | | | | | | | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | (SQL) Media types: Refactor backrefnames.Elrond2012-12-245-5/+20
| | | | | | | | | | | | | | | | | | | | | We need to know the name of the backref, so that we can access it by name on the MediaEntry. We might be able to get this name by inspection, but this way is easier, for now.
* | | Remove mongo style .id = ObjectId()Elrond2012-12-242-6/+0
| | | | | | | | | | | | | | | On SQL we can't generate the primary key on our own. So just remove this stuff.
* | | Mongo removal: Remove the validate=True arg to obj.save()Elrond2012-12-246-10/+9
| | | | | | | | | | | | | | | all callers were forced to use validate=True anyway. So remove this useless stuff.
* | | Fix some unicode related issues in oauth and the api.Elrond2012-12-232-2/+2
| | | | | | | | | | | | Found using the previous commit.
* | | Testsuite: Turn SQLAlchemy warnings into errorsElrond2012-12-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should handle SQLAlchemy warnings. And to make that a lot easier, turn them into real errors. That way they 1) Turn up more prominently. 2) Have a useful backtrace. This only happens in the testsuite, so that normal useage is not impacted.
* | | Added API testsJoar Wandborg2012-12-233-1/+107
| | |
* | | Rewrite routing using new MGRoute classElrond2012-12-232-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MGRoute subclasses Rule(): Rule doesn't have a way to tag extra data, like the controller function, we need. So MGRoute has a new attribute .gmg_controller, which holds this. Rewrite everything to use this new Rule variant and drop all the other stuff that mapped endpoints to controller functions, mostly.