File: utils.py

package info (click to toggle)
django-pipeline 4.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: python: 3,170; makefile: 120; javascript: 59
file content (20 lines) | stat: -rw-r--r-- 621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os

import django
from django.test import override_settings


def _(path):
    # Make sure the path contains only the correct separator
    return path.replace("/", os.sep).replace("\\", os.sep)


class pipeline_settings(override_settings):
    kwarg_name = None
    def __init__(self, **kwargs):
        if django.VERSION[:2] >= (1, 10):
            # Django 1.10's override_settings inherits from TestContextDecorator
            # and its __init__ method calls its superclass' __init__ method too,
            # so we must do the same.
            super().__init__()
        self.options = {"PIPELINE": kwargs}