mirror of
https://github.com/django-components/django-components.git
synced 2025-08-09 16:57:59 +00:00
refactor: usage notes + tests for safer_staticfiles (#538)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
3dadba6636
commit
23d91218bd
13 changed files with 226 additions and 4 deletions
16
tests/components/safer_staticfiles/safer_staticfiles.py
Normal file
16
tests/components/safer_staticfiles/safer_staticfiles.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from django_components import component
|
||||
|
||||
|
||||
# Used for testing the safer_staticfiles app in `test_safer_staticfiles.py`
|
||||
@component.register("safer_staticfiles_component")
|
||||
class RelativeFileWithPathObjComponent(component.Component):
|
||||
template_name = "safer_staticfiles.html"
|
||||
|
||||
class Media:
|
||||
js = "safer_staticfiles.js"
|
||||
css = "safer_staticfiles.css"
|
||||
|
||||
def get_context_data(self, variable, *args, **kwargs) -> Dict[str, Any]:
|
||||
return {"variable": variable}
|
Loading…
Add table
Add a link
Reference in a new issue