From 3315ec72a9ede4f0bf0b90c8cb8552eb2c349167 Mon Sep 17 00:00:00 2001 From: Aider Ibragimov Date: Wed, 14 Oct 2015 12:57:49 +0300 Subject: [PATCH] fix ci build, make more clear flow --- rest_framework/validators.py | 2 +- tests/test_validators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/validators.py b/rest_framework/validators.py index 79cdbf4c8..7042b4d6c 100644 --- a/rest_framework/validators.py +++ b/rest_framework/validators.py @@ -65,7 +65,7 @@ class UniqueValidator(object): try: exists = queryset.exists() except DataError: - return + exists = False if exists: raise ValidationError(self.message) diff --git a/tests/test_validators.py b/tests/test_validators.py index 347f9b723..ad91f3271 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -79,7 +79,7 @@ class TestUniquenessValidation(TestCase): data = {'ip': 'test', 'username': 'test'} serializer = UniquenessSerializer(data=data) assert not serializer.is_valid() - assert serializer.errors == {'ip': [u'Enter a valid IPv4 address.', u'Enter a valid IPv4 or IPv6 address.']} + assert serializer.errors == {'ip': ['Enter a valid IPv4 address.', 'Enter a valid IPv4 or IPv6 address.']} # Tests for `UniqueTogetherValidator`