-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests are failing #1
Comments
After removing @faassen Do you know what's going on? |
When printing out info.key:
<function model_predicate at 0x7fbdeab1d268>
info.key:
<function name_predicate at 0x7fbdeab1d378>
after:
<function model_predicate at 0x7fbdeab1d268>
key_to_info: {
<function request_method_predicate at 0x7fbdeab1d510>: <morepath.predicate.PredicateInfo object at 0x7fbdea98cb00>,
<function model_predicate at 0x7fbdeab1d268>: <morepath.predicate.PredicateInfo object at 0x7fbdea98ca90>,
<function name_predicate at 0x7fbdeab1d378>: <morepath.predicate.PredicateInfo object at 0x7fbdea98cac8>
}
info.key:
<function request_method_predicate at 0x7fbdeab1d510>
after:
<function name_predicate at 0x7fbdeab1d378>
key_to_info: {
<function request_method_predicate at 0x7fbdeab1d510>: <morepath.predicate.PredicateInfo object at 0x7fbdea98cb00>,
<function model_predicate at 0x7fbdeab1d268>: <morepath.predicate.PredicateInfo object at 0x7fbdea98ca90>,
<function name_predicate at 0x7fbdeab1d378>: <morepath.predicate.PredicateInfo object at 0x7fbdea98cac8>
}
info.key:
<function body_model_predicate at 0x7fbdeab2e268>
after:
<function request_method_predicate at 0x7fbdeab1d510>
key_to_info: {
<function body_model_predicate at 0x7fbdeab2e268>: <morepath.predicate.PredicateInfo object at 0x7fbdea75b9b0>
} So when checking for @faassen Is this a bug or am I missing something? |
Aah it seems when using @App.predicate(morepath.App.get_view, name='body_model', default=object,
index=ClassIndex, after=morepath.request_method_predicate)
def body_model_predicate(self, obj, request): instead of @App.predicate(App.get_view, name='body_model', default=object,
index=ClassIndex, after=morepath.request_method_predicate)
def body_model_predicate(self, obj, request): it works (still the 2 tests are failing). So I cannot use |
Good catch! That isn't intentional but it makes sense -- get_view has a different implementation for each subclass due to it being a reg dispatch_method. What are the consequences of the first definition? Does it affect the superclass and make it use the body model predicate after all, or is it unrelated? I think they should still be unrelated but I'm not 100% sure off the top of my head. It would be good to create a test for this package that defines both a body model app and a normal app that derives from morepath.App, and then see that morepath.App doesn't suddenly get a body model or something. Hm, this reminds me of something else that could go wrong: the request is overridden. This can only be done at the top level app, not at lower down apps. But we actually want to enable body model apps as sub-apps. So we'd need a test that mounts the body model app inside of a normal app, and I expect the test will fail. We'd like this to work but that would involve adding a feature. What I think we need to do is add a feature to Morepath so that sub-apps can add new methods/properties to the common shared request. Or alternatively is cloning the request into a new request object when necessary if the sub app defines another request class. The second approach would be cleaner as it separates concerns between requests, but there are some issues: what if a tween expects thing about requests? Tweens only work on the outside. What request class comes back then? I think the request class of the application currently in use. And it requires a reliable way to clone a Morepath request. webob request does expose a |
@faassen Have to look closer at your proposition. The consequences if using local When using Another issue:
And in the example you use only the request argument. This seems to be wrong. |
At the moment all test are failing with:
@faassen Have you an idea what could be the issue?
The text was updated successfully, but these errors were encountered: