aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* RIP out mongoSebastian Spaeth2012-12-251-4/+1
| | | | | | | | | 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-253-15/+279
| | | | | | | | | | | | 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>
* Fix some unicode related issues in oauth and the api.Elrond2012-12-231-1/+1
| | | | 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-232-0/+106
|
* replace webob.Response with werkzeug ResponseSebastian Spaeth2012-12-211-1/+1
| | | | | | | | | | | | Replace webob usage in one more file. Document a TODO that should be clarified, we should probably be using json_response rather than Response() here. Modify the TestMeddleware to not rely on the content_type attribute being present, while werkzeug.wrappers Response() has it the BaseResponse() object which is often returned in tests does not have it. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* tests/auth: Don't rely on case sensitive error stringsSebastian Spaeth2012-12-211-2/+2
| | | | | | | | | | webob's 404 status is "404 NOT FOUND" while werkzeug's is "404 Not Found". Our test suite was checking the upper case string for equality. Just test the status error code "404" rather than the full string which might change at some points/versions and should not need to be tested. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move DBModel._id -> DBModel.idSebastian Spaeth2012-12-213-11/+11
| | | | | | | | | | | | | | | | | | | | | | | We were refering to model._id in most of the code base as this is what Mongo uses. However, each use of _id required a) fixup of queries: e.g. what we did in our find() and find_one() functions moving all '_id' to 'id'. It also required using AliasFields to make the ._id attribute available. This all means lots of superfluous fixing and transitioning in a SQL world. It will also not work in the long run. Much newer code already refers to the objects by model.id (e.g. in the oauth plugin), which will break with Mongo. So let's be honest, rip out the _id mongoism and live with .id as the one canonical way to address objects. This commit modifies all users and providers of model._id to use model.id instead. This patch works with or without Mongo removed first, but will break Mongo usage (even more than before) I have not bothered to fixup db.mongo.* and db.sql.convert (which converts from Mongo to SQL) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix up testsSebastian Spaeth2012-12-213-11/+13
| | | | | | | | | | | | empty find() queries would not work anymore with the simplified .find compatability code, so remove these and use proper sqlalchemy in the tests. The storage test failed because my virtualenv environment ran mediagoblin/local/mediagoblin/tests/test_storage.py and somehow decided the 2 classes are different objects. Just test against the full class name. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* More unicode fixes in the test suiteSebastian Spaeth2012-12-121-6/+7
| | | | | | | | | | Pass in unicode not (binary) strings where sqlite expects unicode values to prevent the test suite from (correctly) complaining about errors. I now pass the full suite without any complaints. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Make sqlalchemy stop complaining about non-unicode inputSebastian Spaeth2012-12-112-4/+4
| | | | | | | | | | | These tests output noisy sql complaints about receiving non-unicode for an unicode field. This was ... well ... because we were handing in non-unicode usernames and passwords. Prefixing usernames/passwords with u'' makes the testsuite less noisy and verbose. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix CSRF tests with webtest 1.4.0Sebastian Spaeth2012-12-111-3/+3
| | | | | | | | | | CSRF tests apparently passed with earlier versions of webtest, but failed with the latest webtest (1.4.0) package. It choked on passing a "key=value; " cookie as it split at the semicolon and failed to find additional values or something like that. Removing the semicolon makes this test pass. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Add a UniqueConstraint add test in test_sql_migrationsChristopher Allan Webber2012-12-051-3/+26
| | | | | We should have this anyway, and Elrond needs it to help fix current broken migration thingies.
* make media_manager a property of MediaEntry in mixin.pySebastian Spaeth2012-12-041-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | In all cases where get_media_manager(_media_type_as_string) was called in our code base we ultimately passed in a "MediaEntry().media_type" to get the matching MEDIA_MANAGER. It so makes sense to make this a function of the MediaEntry rather than a global function in mediagoblin.media_types and passing around media_entry.media_type as arguments all the time. It saves a few import statements and arguments. I also made it so the Media_manager property is cached for subsequent calls, although I am not too sure that this is needed (there are other cases for which this would make more sense) Also add a get_media_manager test to the media submission tests. It submits an image and checks that both media.media_type and media.media_manager return the right thing. Not sure if these tests could not be merged with an existing submission test, but it can't hurt to have things explicit. TODO: Right now we iterate through all existing media_managers to find the right one based on the string of its module name. This should be made a simple dict lookup to avoid all the extra work. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fixed pylint issues, removed unused importJoar Wandborg2012-10-021-1/+1
|
* Replaced all request.POST with request.form, ...Joar Wandborg2012-09-291-8/+17
| | | | | - Fixed error handling in OAuth plugin - Changed request.POST file fields to request.files
* Added OAuth testJoar Wandborg2012-09-291-0/+50
|
* Fixed pylint/pep8 warnings in test/tools.pyJoar Wandborg2012-09-291-2/+2
|
* Added tests for HTTP callbacksJoar Wandborg2012-09-273-3/+76
|
* Added some OAuth plugin testsJoar Wandborg2012-09-263-2/+138
|
* Fixed testsJoar Wandborg2012-09-151-1/+1
| | | | | - Adapt tests to new global_config arg for run_dbupdate - Account for [plugins] not being set in config
* [Issue 466] Implement e-z plugin disablingWill Kahn-Greene2012-07-171-0/+20
|
* Rework plugin infrastructure to nix side-effectsWill Kahn-Greene2012-07-171-30/+27
| | | | | | | | | | | | | This reworks the plugin infrastructure so as to remove module-loading side-effects which were making things a pain in the ass to test. With the new system, there's no auto-registering meta class. Instead plugins do whatever they want and then specify a hooks dict that maps hook names to callables for the things they're tying into. The most common one (and the only one we've implemented so far) is "setup". This also simplifies the sampleplugin a little by moving the code to __init__.py.
* Moving the "dependency injection printer tools" over to tools/common.pyChristopher Allan Webber2012-07-141-12/+1
|
* Update staticdirect stuff so it can handle "domains" of staticdirectionChristopher Allan Webber2012-07-141-0/+9
|
* removed _make_safe in favor of functools.wrapsJakob Kramer2012-07-121-3/+6
|
* Drop our scoped session sooner to prevent SQLAlchemy re-binding warnings.Brett Smith2012-07-081-3/+3
|
* Prevent SQLAlchemy non-Unicode warnings from this test.Brett Smith2012-07-081-8/+8
|
* Prevent SQLAlchemy non-Unicode warnings in this test.Brett Smith2012-07-081-4/+4
|
* More Unicode titles to prevent non-Unicode SQLAlchemy warnings.Brett Smith2012-07-081-2/+6
|
* Prevent non-Unicode SQLAlchemy warnings in most submission tests.Brett Smith2012-07-081-14/+14
| | | | This commit makes test_submission mostly warning-clean.
* Level exits are Unicode too.Brett Smith2012-07-041-3/+3
|
* Make sure MigrationManagers always get Unicode names.Brett Smith2012-07-041-4/+4
| | | | | If we fail to do this, SQLAlchemy complains that we're binding a non-Unicode value to a Unicode column.
* Merge remote-tracking branch ↵Joar Wandborg2012-06-101-0/+1
|\ | | | | | | | | | | | | 'is_derek/bug405_email_notifications_for_comments' into notifications-merge Conflicts: mediagoblin/db/mongo/migrations.py
| * Merge branch 'master' into derek-moore-bug405_email_notifications_for_commentsChristopher Allan Webber2012-03-181-0/+15
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/mongo/migrations.py
| * | These are changes for issue #405, add email comment notification.Derek Moore2012-03-151-0/+1
| | |
* | | Fix problems from pyflakes outputWill Kahn-Greene2012-06-035-10/+2
| | |
* | | 401. Plugin infrastructureWill Kahn-Greene2012-05-131-0/+158
| | | | | | | | | | | | | | | | | | | | | | | | * implements installing, loading and setup for plugins * codifies configuration * has a sample plugin * docs * tests
* | | No need to keep around mongodb migration tests.Christopher Allan Webber2012-04-291-401/+0
| | |
* | | Merge remote-tracking branch 'refs/remotes/elrond/sql/final'Christopher Allan Webber2012-04-015-35/+47
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/tests/test_submission.py Also, WHOO SQL SWITCHOVER PARTY! ASCII DANCE PARTY /_o_/ \ / \o_ o ( _|_ ) //) /\ / o \ /| /| *BMCH BMCH BMCH BMCH* % /_o_/ HHHYAAaaaaa /_ / / % AAAAAHAHAHAHAHHHAAHA ,, .------ o_o ;; /\\ \ $ __ '\/ || // \\ # /_/ \// // //\\ \ ) \\ \ % \\ \\_____\ | ) //------- /_/_ // // SWITCH YOUR DATABASE FLIP A FUKKEN BOOLEAN % __________ .-' '-. .' '. .' _--_ _--_ '. / / (_). / (_). \ . | | | | . | ._____, ._____, | | ____________________ | | | | | ' \ / ' \ '. .----./ / \ '._ / / / '. '--------' .' '._ _.' '----------'
| * | | Fix unit tests for sql: cache media_id.Elrond2012-04-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Attributes of SQLAlchemy objects get "lost". So "cache" them locally in the code. This is really the simple explanation for some scarry sqlalchemy details.
| * | | Reload the user for current values.Elrond2012-03-261-0/+1
| | | | | | | | | | | | | | | | This might not be needed, but it helped at one point.
| * | | Reload and detach the test user.Elrond2012-03-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code often needs to know some fields of the test user even after doing some sql and stuff. The solultion is to reload it and properly detach it from its Session. That way all its fields are available and the whole thing is not connected to a session. It feels like a normal object.
| * | | TestSubission's tag check stuff passing nowChristopher Allan Webber2012-03-261-3/+5
| | | |
| * | | Remove the user_dev directory on tests endingChristopher Allan Webber2012-03-261-7/+7
| | | | | | | | | | | | | | | | (We used to remove the mongo db on tests ending...)
| * | | Suggest we move to an in-memory database ;)Christopher Allan Webber2012-03-261-1/+1
| | | |
| * | | SQL based tests and refactored Celery setup stuffChristopher Allan Webber2012-03-262-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | - Changed config files of test configs to use SQL - Updated celery initialization tools, factored them to be able to use the "big instance" application stuff
* | | | Fixed test_submission -> test_evil_file testJoar Wandborg2012-03-271-3/+2
| | | |
* | | | Merge remote-tracking branch 'joar/audio+sniffing'Joar Wandborg2012-03-271-7/+30
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/media_types/image/processing.py mediagoblin/media_types/video/__init__.py mediagoblin/media_types/video/processing.py mediagoblin/tests/test_submission.py
| * | | | Faster sniffingJoar Wandborg2012-03-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Sniffing now goes through the old extension-based filter before doing it the bitsniffing way. - Refractored get_media_type_and_manager(filename). - Removed ogg extension from video accepted extensions, audio will take care of that. - Added custom audio player, still WIP,but working. - Added test for sniffing. This only tests for the mediagoblin.media_types.image type, as that is the only one enabled from start.