aboutsummaryrefslogtreecommitdiffstats
path: root/api/tests/test_models.py
blob: 7ed49a788999f36fc50f8132406a9c9c80cc52a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from django.test import SimpleTestCase

from ..models import ModelReprMixin


class SimpleClass(ModelReprMixin):
    def __init__(self, is_what):
        self.the_cake = is_what


class ReprMixinTests(SimpleTestCase):
    def setUp(self):
        self.klass = SimpleClass('is a lie')

    def test_shows_attributes(self):
        expected = "<SimpleClass(the_cake='is a lie')>"
        self.assertEqual(repr(self.klass), expected)