ospc-org / ospc.org

Source code for PolicyBrain, ospc.org, and related assets.
MIT License
24 stars 32 forks source link

Make tests fail when invalid variables are used inside templates #925

Closed lucassz closed 6 years ago

lucassz commented 6 years ago

By default, if a variable that isn't present in the context is used in a template, Django simply skips it, rather than raising an exception. This might not be good even in production, but I suggest that at least in testing we use something like this snippet to override this with strict checking, to catch misspellings, templates that use a variable that isn't accessible, etc. This could be done by creating a testing-specific settings.py file or some other method.

hdoupe commented 6 years ago

@lucassz is #925 relevant to #266?

lucassz commented 6 years ago

@hdoupe Yes, that's the same issue actually. Thanks for bringing that up.