Skip to content

Commit

Permalink
Stop usage of django.utils.six
Browse files Browse the repository at this point in the history
- Six is no longer present in Django 3.0 +
  • Loading branch information
DavisRayM committed Jan 21, 2020
1 parent fe6b67d commit 25c97cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"Programming Language :: Python :: 3.6",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.0",
],
)
3 changes: 2 additions & 1 deletion tests/serializers/test_segment_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def test_validate_bad_data(self):
name="Rule Zero",
description="Some description",
target_content_type=self.task_type.id,
active=False,
target_field="invalid_field",
target_field_value=6,
target_app_label="tasking",
Expand All @@ -85,5 +86,5 @@ def test_validate_bad_data(self):
self.assertFalse(instance.is_valid())
self.assertEqual(
"Task has no field named 'invalid_field'",
str(instance.errors["target_field"][0]),
instance.errors["target_field"][0],
)
9 changes: 2 additions & 7 deletions tests/viewsets/test_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os

from django.test import override_settings
from django.utils import six

import pytz
from model_mommy import mommy
Expand Down Expand Up @@ -117,9 +116,7 @@ def test_create_location_with_shapefile_nested_multipolygons(self):
response = view(request=request)
self.assertEqual(response.status_code, 400)
self.assertIn("shapefile", response.data.keys())
self.assertEqual(
INVALID_SHAPEFILE, six.text_type(response.data["shapefile"][0])
)
self.assertEqual(INVALID_SHAPEFILE, response.data["shapefile"][0])

# should work
with self.settings(TASKING_SHAPEFILE_ALLOW_NESTED_MULTIPOLYGONS=True):
Expand Down Expand Up @@ -151,9 +148,7 @@ def test_create_location_with_shapefile_ignore_invalid(self):
response = view(request=request)
self.assertEqual(response.status_code, 400)
self.assertIn("shapefile", response.data.keys())
self.assertEqual(
INVALID_SHAPEFILE, six.text_type(response.data["shapefile"][0])
)
self.assertEqual(INVALID_SHAPEFILE, response.data["shapefile"][0])

# should work
with self.settings(TASKING_SHAPEFILE_IGNORE_INVALID_TYPES=True):
Expand Down

0 comments on commit 25c97cf

Please sign in to comment.