"""
Tests for L{klein.plating}.
"""

from __future__ import (
    absolute_import, division, print_function, unicode_literals
)

import json

from klein import Plating
from twisted.web.template import tags, slot
from twisted.web.error import FlattenerError, MissingRenderMethod

from klein.test.test_resource import requestMock, _render
from klein.test.util import TestCase
from klein import Klein

page = Plating(
    defaults={
        "title": "default title unchanged",
        Plating.CONTENT: "NEVER MIND THE CONTENT",
    },
    tags=tags.html(
        tags.head(tags.title(slot("title"))),
        tags.body(
            tags.h1(slot("title")),
            tags.div(slot(Plating.CONTENT),
                     Class="content")
        )
    ),
)

element = Plating(
    defaults={
        "a": "NO VALUE FOR A",
        "b": "NO VALUE FOR B",