File: test_fields.py

package info (click to toggle)
python-django-colorfield 0.4.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 260 kB
  • sloc: javascript: 2,510; python: 231; makefile: 10; sh: 2
file content (32 lines) | stat: -rw-r--r-- 698 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-

from django import forms
from django.forms import fields_for_model
from django.db import models
from django.test import TestCase

from colorfield.fields import ColorField


class ColoredModel(models.Model):
    colors = ColorField(blank=True)

    class Meta:
        app_label = 'colorfield'


class ColorFieldTestCase(TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_model_formfield_doesnt_raise(self):
        """Adding a ColoredField to a model should not fail in 2.2LTS
        """
        try:
            fields_for_model(ColoredModel())
        except AttributeError:
            self.fail('Raised Attribute Error')