Python django.test.utils 模块,ContextList() 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用django.test.utils.ContextList()

项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def store_rendered_templates(store, signal, sender, template, context, **kwargs):
    """
    Stores templates and contexts that are rendered.

    The context is copied so that it is an accurate representation at the time
    of rendering.
    """
    store.setdefault('templates', []).append(template)
    store.setdefault('context', ContextList()).append(copy(context))
项目:zing    作者:evernote    | 项目源码 | 文件源码
def clean(self, data):
        """Cleans up `data` before using it as a snapshot reference."""
        if isinstance(data, RequestContext):
            return self.clean(data.flatten())
        # XXX: maybe we can do something smarter than blacklisting when we
        # have a `ContextList`?
        elif isinstance(data, dict) or isinstance(data, ContextList):
            return {
                key: self.clean(data[key]) for key in data.keys()
                if key not in BLACKLISTED_KEYS
            }
        elif isinstance(data, list):
            return [self.clean(item) for item in data]
        return data
项目:lifesoundtrack    作者:MTG    | 项目源码 | 文件源码
def store_rendered_templates(store, signal, sender, template, context, **kwargs):
    """
    Stores templates and contexts that are rendered.

    The context is copied so that it is an accurate representation at the time
    of rendering.
    """
    store.setdefault('templates', []).append(template)
    if 'context' not in store:
        store['context'] = ContextList()
    store['context'].append(copy(context))
项目:liberator    作者:libscie    | 项目源码 | 文件源码
def store_rendered_templates(store, signal, sender, template, context, **kwargs):
    """
    Stores templates and contexts that are rendered.

    The context is copied so that it is an accurate representation at the time
    of rendering.
    """
    store.setdefault('templates', []).append(template)
    if 'context' not in store:
        store['context'] = ContextList()
    store['context'].append(copy(context))
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def store_rendered_templates(store, signal, sender, template, context, **kwargs):
    """
    Stores templates and contexts that are rendered.

    The context is copied so that it is an accurate representation at the time
    of rendering.
    """
    store.setdefault('templates', []).append(template)
    store.setdefault('context', ContextList()).append(copy(context))
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def store_rendered_templates(store, signal, sender, template, context, **kwargs):
    """
    Stores templates and contexts that are rendered.

    The context is copied so that it is an accurate representation at the time
    of rendering.
    """
    store.setdefault('templates', []).append(template)
    store.setdefault('context', ContextList()).append(copy(context))
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def store_rendered_templates(store, signal, sender, template, context, **kwargs):
    """
    Stores templates and contexts that are rendered.

    The context is copied so that it is an accurate representation at the time
    of rendering.
    """
    store.setdefault('templates', []).append(template)
    store.setdefault('context', ContextList()).append(copy(context))