aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Move db.sql.migration_tools to db.migration_tools.Elrond2013-01-081-1/+1
| | | | Follow the new trend.
* Move all the migration tools into new migration_tools.pyElrond2013-01-081-1/+1
| | | | | | | | | 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.
* 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>
* Mv db.sql.base to db.baseSebastian Spaeth2013-01-072-3/+2
| | | | | | | | 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 db.sql.models* to db.models*Sebastian Spaeth2013-01-072-2/+2
|
* Move db.sql.util to db.utilSebastian Spaeth2013-01-071-1/+1
| | | | | | | | 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.
* Also make slug unit test work with the new optionally-translitcodec-free codeChristopher Allan Webber2013-01-061-7/+7
|
* Remove temporary emacs files that have slipped inSebastian Spaeth2012-12-252-275/+0
| | | | Thanks Elrond for hilighting this :-)
* 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 % __________ .-' '-. .' '. .' _--_ _--_ '. / / (_). / (_). \ . | | | | . | ._____, ._____, | | ____________________ | | | | | ' \ / ' \ '. .----./ / \ '._ / / / '. '--------' .' '._ _.' '----------'