Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 1, 2023
1 parent 6ec0c0c commit 62928cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import sys

import os
from setuptools import find_packages, setup


Expand Down
5 changes: 0 additions & 5 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class SomeEnum(Enum):

class TestEnumField(SimpleTestCase):
def test_choices(self):

field = EnumField(choices=SomeEnum)

self.assertDictEqual(field.choices, {"test1": 1, "test2": 2})
Expand All @@ -25,7 +24,6 @@ def test_choices(self):
self.assertDictEqual(field.choices, {"test1": 1, "test2": 2})

def test_to_internal_value_works(self):

field = EnumField(choices=SomeEnum)

self.assertEqual(field.to_internal_value(2), SomeEnum.test2)
Expand All @@ -37,7 +35,6 @@ def test_to_internal_value_works(self):
self.assertEqual(field.to_internal_value("test2"), SomeEnum.test2)

def test_to_internal_value_validates(self):

field = EnumField(choices=SomeEnum)

with self.assertRaises(ValidationError):
Expand All @@ -55,13 +52,11 @@ def test_to_internal_value_validates(self):
field.to_internal_value(3)

def test_to_representation_works(self):

field = EnumField(choices=SomeEnum)

self.assertEqual(field.to_representation(SomeEnum.test1), "test1")

def test_to_representation_handles_none(self):

field = EnumField(choices=SomeEnum)

value = field.to_representation(None)
Expand Down

0 comments on commit 62928cd

Please sign in to comment.