mirror of
https://github.com/jazzband/django-eav2.git
synced 2026-03-16 22:40:26 +00:00
tests + migration file updated
This commit is contained in:
parent
2ff929281a
commit
3b8d28c49e
3 changed files with 6 additions and 4 deletions
|
|
@ -45,4 +45,4 @@ class Migration(migrations.Migration):
|
|||
serialize=False,
|
||||
),
|
||||
),
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -35,17 +35,18 @@ class AttributeTestCase(TestCase):
|
|||
class ValueModelTestCase(TestCase):
|
||||
def setUp(self):
|
||||
eav.register(User)
|
||||
self.attribute = Attribute.objects.create(name='Test Attribute', datatype=Attribute.TYPE_TEXT, slug="test_attribute")
|
||||
self.attribute = Attribute.objects.create(
|
||||
name='Test Attribute', datatype=Attribute.TYPE_TEXT, slug="test_attribute"
|
||||
)
|
||||
self.user = User.objects.create(username='crazy_dev_user')
|
||||
user_content_type = ContentType.objects.get_for_model(User)
|
||||
self.value = Value.objects.create(
|
||||
entity_id=self.user.id,
|
||||
entity_ct=user_content_type,
|
||||
value_text='Test Value',
|
||||
attribute=self.attribute
|
||||
attribute=self.attribute,
|
||||
)
|
||||
|
||||
def test_value_str(self):
|
||||
expected_str = f'{self.attribute.name}: "{self.value.value_text}" ({self.value.entity_pk_int})'
|
||||
self.assertEqual(str(self.value), expected_str)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from django.forms import Textarea
|
|||
from django.test import TestCase
|
||||
from eav.widgets import CSVWidget
|
||||
|
||||
|
||||
class TestCSVWidget(TestCase):
|
||||
def test_prep_value_string(self):
|
||||
self._extracted_from_test_prep_value_empty_2("Test Value")
|
||||
|
|
|
|||
Loading…
Reference in a new issue