def script_tag(request): stork = Stork(request.site.theme) return direct_to_template(request, template='stork/main.js', extra_context={ 'swatch_json': stork.swatch_json(), 'font_json': stork.font_json() })
def test_outputs_swatch_json(): theme = Theme.objects.create(name='test') panels = Stork(theme, config_path='stork/tests/fixtures/valid.yml') panels.save() swatch_json_as_list = json.loads(panels.swatch_json()) assert swatch_json_as_list == [ s.for_json() for s in panels.swatches ]