31 Commits

Author SHA1 Message Date
Christopher Allan Webber
5305fee13b Merge branch 'rodney757-media_plugins'
Conflicts:
	mediagoblin.ini
	mediagoblin/tests/test_mgoblin_app.ini
2013-07-12 16:24:36 -05:00
Christopher Allan Webber
41a14c6efc Merge remote-tracking branch 'remotes/lotusecho/trac_711_test_speed' 2013-07-03 14:07:11 -05:00
Rodney Ewing
5adb906a0a merge --squash openid branch to take care of a false merge commit in the
basic_auth branch that openid is forked from

Commits squashed together (in reverse chronological order):
 - do the label thing only for boolean fields
 - made edit_account to autofocus on the first field
 - added feature to render_divs where if field.label == '' then it
   will render form.description the same a render_label
 - added allow_registration check
 - refactored create_user
 - removed verification_key from create_user
 - removed get_user from openid
 - cleanup after removing openid from template_env.globals
 - fix for werkzueg 0.9.1
 - cleanup after merge
 - more tests
 - restored openid extra_validation just for safety
 - tests for openid
 - deleted openid extra_validation
 - passed next parameter in session for openid
 - fixed a bug that was deleting the messages
 - implemented openid store using sqlalchemy
 - ask openid provider for 'nickname' to prefill username in registration form
 - refactored delete openid url to work with generic urls such as
   google and to not allow a user to delete a url if it is there only
   one and they don't have a pw
 - refactored login to register user workflow, which fixed a problem
   where the 'or register with a password link' wasn't showing up when
   the finish_login view called the register view because there wasn't
   any redirect.
 - added the ability to remove openid's
 - added the ability to add openids to an existing account
 - refactored start_login and finish_login views
 - modified edit_account.html to use render_divs
 - modified gmg/edit/views to behave appropriatly if no password
   authentication is enabled. moved the update email stuff to it's own
   funtion to make edit_account view cleaner. edit_account now
   modifies the form depending on the plugins.
 - minor typos
 - added retrieving email from openid provider
 - moved allow_registration check to a decorator
 - moved check if auth is enabled to a decorator
 - changed openid user registration to go through login first
 - cleanup after merge
 - modified verification emails to use itsdangerous tokens
 - added error handling on bad token, fixed route, and added tests
 - added support for user to change email address
 - added link to login view openid/password in login template
 - updated openid get_user function
 - modified get_user function to take kwargs instead of username
 - no need for user might be email kwarg in check_login_simple
 - added gen_password_hash and check_password functions to auth/__init__
 - added focus to form input
 - made imports fully qualified
 - modified basic_auth.check_login to check that the user has a pw_hash first
 - changed occurances of form.data['whatever'] to form.whatever.data
 - convert tabs to spaces in register template, remove unsed
   templates, and fixed trans tags in templates
 - in process of openid login. it works, but needs major imporvements
 - make password field required in basic_auth form
 - check if password field present in basic_auth create_user
 - modified openid create_user function
 - modified models based on Elronds suggestions
 - changed register form action to a variable to be passed in by the
   view using the template
 - openid plugin v0, still need to authenticate via openid.
 - added a register_user function to be able to use in a plugin's
   register view, and modified auth/views.register to redirect to
   openid/register if appropriate.
 - Modified basic_auth plugin to work with modified auth plugin
   hooks. Added context variables. Removed basic_auth/tools which was
   previously renamed to basic_auth/lib.
 - modified auth/__init__ hooks to work better with multiple
   plugins. Removed auth/lib.py. And added a basic_extra_verification
   function that all plugins will use.
 - added models and migrations for openid plugin
2013-07-03 13:49:16 -05:00
Rodney Ewing
e699197258 fixed some typos and enabled media_type plugins in tests 2013-07-02 08:06:39 -07:00
Emily O'Leary
4a698535bc Improved test runtime from 352 seconds to 59 seconds by implementing an in-memory sqlite DB and including an option to run migrations on this newly created database by adding a config option called run_migrations to the config_spec and passing it along in app.py to the setup_database function. 2013-06-25 20:57:50 -04:00
Rodney Ewing
54ef2c408b moved authentication_disabled to config_spec 2013-06-15 12:32:20 -07:00
Rodney Ewing
5101c469d7 changed no_auth to authentication_disabled in config 2013-06-11 14:30:38 -07:00
Rodney Ewing
fa7232913c modified test .ini files and changed tests to use basic_auth bcrypt 2013-05-24 16:52:48 -07:00
Christopher Allan Webber
491029bc36 Moving test_user_dev->user_dev in plugin app configs & adding plugin static serving
The test_user_dev (as opposed to user_dev) was a legacy before we had
each application running in its own directory (as they now do in
pytest).  Move that name to just user_dev... this is more consistent
with the rest of our naming and will make writing these config files
easier.  (If we want to test that changing these still works, that
should be a separate unit test with special config files.)

Additionally, add plugin static serving to the common test paste
config file.

This commit sponsored by Juan Jose Marin Martinez.  Thank you!
2013-05-23 13:33:07 -05:00
Elrond
76f0fb8cca piwigo: Start first tests.
This first test checks the session logic of the piwigo
plugin. login, logout, getStatus.
2013-05-12 23:19:58 +02:00
Christopher Allan Webber
a98c95b41d Tests should no longer use the environment-variable-related-setup and set up in app instead
This should remove a bunch of confusing cruft.  I hate using that
environment variable!  Also that old code was fragile.

This commit sponsored by Stephen Milton.  Thanks!
2013-05-12 15:55:59 -05:00
Alon Levy
a80ebf3b64 add pdf media type
The new media type supports pdf and a subset of media recognized by libreoffice via
unoconv.

Every document added goes through:
* conversion to pdf with unoconv if not already a pdf
* creation of thumbnail and medium sized image, and pdfinfo generates
 some information (even for unoconv produces docs - should fix this)

Poppler (pdftocairo, pdfinfo) is used.  http://poppler.freedesktop.org/

A working but uglified pdf.js integration exists, which is enabled by
setting pdf.pdf_js=true mediagoblin_local.ini (disabled in mediagoblin.ini)

Adds one test to the test_submission test suite, and another separate test_pdf suite.
The tests are only run if media_types.pdf.processing.check_prerequisites passes, so
the test suite will not require any extra package.

TODO: make test suite say 'skipped' in that case instead of just 'ok'

Signed-off-by: Alon Levy <alon@pobox.com>
2013-04-15 09:51:21 +03:00
Elrond
82a40cc4e1 Remove the last traces of beaker.
There were still some traces of beaker around:
- docs: replaced by reference to itsdangerous.
- paste configs: Wiped away.
- config_spec.ini: wiped.
- test_mgoblin_app.ini: also wiped.
2013-04-09 22:39:04 +02:00
Joar Wandborg
57c6473aa2 Added API tests 2012-12-23 21:45:46 +01:00
Joar Wandborg
0df00eb68f Added tests for HTTP callbacks 2012-09-27 00:45:25 +02:00
Joar Wandborg
a11aa2d17a Added some OAuth plugin tests 2012-09-26 23:53:51 +02:00
Christopher Allan Webber
8e96bcbc78 Suggest we move to an in-memory database ;) 2012-03-26 11:31:09 -05:00
Christopher Allan Webber
d693f6bd86 SQL based tests and refactored Celery setup stuff
- 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
2012-03-26 11:14:11 -05:00
Christopher Allan Webber
e9f87f728c Fix tests given recent celery "case" change 2012-02-28 13:31:03 -06:00
Elrond
c2d6792ddb Test Suite: Enable attachments, add failing test
attachments are an optional part. But it doesn't hurt to
enable them in the test suite at all.

Also (with enabled attachmemtns) the main media view fails,
if one isn't logged in (joar found it!).  So add a simple
(currently failing) test for this.
2012-01-10 12:52:01 +01:00
Manuel Urbano Santos
d5bb51f9d4 * Feature #678: Drop custom delimiters in tags
* Eliminate the definition of the tag delimiter for tests.
  * Remove a test that was related to custom tags delimiter.
* Bug #671: Tags list on Edit page is not seperated by spaces and hard to read
  * Modify a test to include this space.
2011-11-27 13:55:07 +01:00
Elrond
91b89bde47 591: Let Testing Middleware check for staticdirect() usage
All references to static, shipped content should go via
request.staticdirect().

So insert a TestingMiddleware in the chain, which tests for
this on all requests/reponses happening in the test suite.
It's a simple text search for a bogus usage pattern.
2011-10-19 21:37:19 +02:00
Christopher Allan Webber
fc21a55c76 Turning on caching for mediagoblin testing after all?
Maybe we'll add a way to toggle this.
2011-09-05 23:28:11 -05:00
Christopher Allan Webber
0533f117a9 Basic beaker caching functionality added to the application. 2011-08-23 23:22:17 -05:00
Christopher Allan Webber
ba880861c3 Must switch queuestore_base_dir -> base_dir in test_mgoblin_app.ini 2011-08-23 22:56:22 -05:00
Christopher Allan Webber
63c9a0c766 Updating tests for new storage config code 2011-08-21 15:14:45 -05:00
Christopher Allan Webber
1b89b817e5 Removing option to make tags lowercase
...that's basically handled by the slugification
2011-07-30 21:54:18 -05:00
Caleb Forbes Davis V
8ff4dec742 Adds tag unit testing
- overrides default tag parsing globals in test_mgoblin_app.ini
- piggybacks on existing test_submission code to check correct tag
  parsing and storage in the database
- verifies expected behavior given different delimiters, case
  sensitivities, tags that are too long, and extra whitespace
- verifies list-of-dict database storage and tag slugification
2011-07-29 14:04:49 -05:00
Elrond
073b61fe53 Move mediagoblin.celery_setup -> mediagoblin.init.celery
As the first target of the new .init. submodule move
celery_setup there. Quite straight forward, just a lot of
places to change.
2011-07-02 20:50:23 +02:00
Christopher Allan Webber
9ea5c28b7a Celery wasn't really being properly connected during tests.
Lots of fixes to do this.

 - setup_celery_from_config no longer responsible for checking
   'celery_setup_elsewhere'; that's the app's job.  (This was a problem
   because more than the app was relying on using this function)
 - Allow us to specifically set the config file we're setting up
   celery from with setup_self
 - Set up celery_always_eager.  This is something we strongly want
   while doing tests.
 - Instead of setting up the app in the get_test_app method, let's set
   that up simply by importing from_tests, which should itself up via
   from_celery being the environment variable being set.
2011-06-26 14:45:19 -05:00
Christopher Allan Webber
623bee73b1 Nosetests should now be able to run using the new configobj / app init setup
Lots of changes:
 - CELERY_CONFIG_FILE does not need to be set to the from_tests module
   to run tests anymore, in fact it *should not be set at all* and is
   specifically forbidden.
 - moved around the configuration to the new 2-file format
 - and generally adjusting the code appropriately.
2011-06-18 20:14:33 -05:00