Comments (8)
It took me a couple of goes to figure out how to run the tests (not least because the settings.py
needs a patch to make it work with Django 1.8).
It looks to me as if this is primarily a bug in the tests. What appears to be happening is that Django 1.8 (and possibly 1.7 as well) build their app registry before the test code edits INSTALLED_APPS
, with the result that the only application Django knows about is overextends
. I’m not sure how to fix that; the app registry doesn’t have any public API to add applications. The most sensible approach is probably to build the test in a static configuration, rather than trying to dynamically generate and add applications, but I think that’s something for you to decide as the package author.
There is also an additional bug in that calling loader.load_template_source(name, [])
will actually find the template (if you check the Django sources, you’ll see that it does if not template_dirs
rather than if template_dirs is None
when deciding whether you specified template directories to search). Thus there should be an
if not dirs:
break
in the code in overextends_tags.py
.
I've submitted another pull request to fix the problem of the tests not running because of the code in settings.py
, and also to add the above change in overextends_tags.py
. That doesn’t change the fact that the tests are going to continue breaking because of the application registry problem.
from django-overextends.
Note that #17 does not completely fix this problem because a decision needs to be made about how to fix the test rig.
from django-overextends.
Maybe if we somehow used override_settings
decorator on INSTALLED_APPS
we could maintain the current behaviour?
https://docs.djangoproject.com/en/1.8/topics/testing/tools/#overriding-settings
Also just discovered a new modify_settings
API as for Django 1.7:
That matches more closely to what the tests are currently doing, and might be a lot easier to work with (since the decorators need to run at import time). I think it would be fine to drop support for Django 1.6 and earlier - what do you think?
from django-overextends.
BTW thanks for going to all the trouble of diving deeply into this, it's really appreciated.
from django-overextends.
@stephenmcd Django 1.6 doesn't need to be supported imo since 1.7 is a LTS, yes. modify_settings
looks good.
from django-overextends.
@jleclanche want to try and finish it off then?
from django-overextends.
I can't take care of it for a while I'm afraid.
from django-overextends.
No problem! I just assumed you needed it now.
from django-overextends.
Related Issues (17)
- overextending more than three templates not working HOT 3
- Test fails HOT 3
- Merging with app-namespace-template-loader? HOT 1
- Custom inheritance order? HOT 1
- ImportError raised loading overextends.templatetags.overextends_tags: cannot import name find_template_loader HOT 5
- Support Django 1.9 HOT 4
- AttributeError: 'unicode' object has no attribute 'resolve' HOT 2
- Django 1.9 support HOT 2
- TemplateDoesNotExist in complex cases
- Declare sphinx-me as an extra dependency HOT 2
- Is this behavior now part of Django? HOT 1
- Update readme to reflect that django 'extends' now natively supports this feature. HOT 2
- Django 2.0 support HOT 2
- There can be valid tags before ExtendsNode
- Overextends skips the template with different filename even when it would not create a cycle HOT 9
- Package should probably user render_context and not context HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-overextends.