-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from bckohan/v2.x.x
V2.0.2
- Loading branch information
Showing
7 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "django-enum" | ||
version = "2.0.1" | ||
version = "2.0.2" | ||
description = "Full and natural support for enumerations as Django model fields." | ||
authors = ["Brian Kohan <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.test import TestCase | ||
from pathlib import Path | ||
from decimal import Decimal | ||
from django_enum.forms import EnumChoiceField | ||
from django_enum.utils import choices | ||
|
||
|
||
class TestNameOverride(TestCase): | ||
""" | ||
https://github.com/bckohan/django-enum/issues/77 | ||
""" | ||
|
||
def test_name_override(self): | ||
from tests.djenum.models import NameOverrideTest | ||
|
||
self.assertEqual(NameOverrideTest._meta.get_field("enum_field").primitive, str) | ||
|
||
NameOverrideTest.objects.create(enum_field="V1") | ||
obj = NameOverrideTest.objects.first() | ||
self.assertEqual(obj.enum_field, "V1") | ||
self.assertEqual(obj.get_enum_field_display(), "Value 1") |