mozilla-services / cliquet

CLIQUET IS NOW DEPRECATED use kinto.core instead
http://github.com/Kinto/kinto
Other
64 stars 16 forks source link

Distinguish before/after events #651

Closed leplatrem closed 8 years ago

leplatrem commented 8 years ago

(revamp of #644)

tldr: We need two kinds of events: before events to run within transaction and «rollbackable». after events to run irreversible actions (that can fail)

Feedback/Critics/Stones/Hugs/Flowers welcome!

almet commented 8 years ago

LGTM but lacks documentation (I see there is some in the CHANGELOG but I don't believe that's enough)

leplatrem commented 8 years ago

I'm puzzled :

View transactions tests pass when I run them isolated:

nosetests -s --with-mocha-reporter cliquet.tests.resource.test_events cliquet.tests.test_listeners cliquet.tests.test_views_transaction

But they don't if I run the whole test suite make test-once. The resource events are simply not triggered :(

leplatrem commented 8 years ago

Ok, found it.

In test_permission.py we alter request.registry.settings to readonly. Settings was not a copy of DEFAULT_SETTINGS and the tests were altering the default settings!

Natim commented 8 years ago

Great job r+ with nit.