File: test_color.py

package info (click to toggle)
python-django-extensions 4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,812 kB
  • sloc: python: 18,601; javascript: 7,354; makefile: 108; xml: 17
file content (21 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
from django.test import SimpleTestCase
from django_extensions.management import color
from . import force_color_support


class ColorTest(SimpleTestCase):
    def test_no_style(self):
        with force_color_support:
            style = color.no_style().MODULE_NAME
            text = "csv"
            styled_text = style(text)
            self.assertEqual(text, styled_text)

    def test_color_style(self):
        with force_color_support:
            style = color.color_style().MODULE_NAME
            text = "antigravity"
            styled_text = style(text)
            self.assertIn(text, styled_text)
            self.assertNotEqual(text, styled_text)