mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 19:10:12 +03:00
Removed test for ObtainAuthToken serializer raising ValidationError because ValidationError will be raised.
This commit is contained in:
parent
4440803620
commit
8adb05418d
|
@ -10,7 +10,6 @@ from rest_framework.authtoken.management.commands.drf_create_token import \
|
||||||
Command as AuthTokenCommand
|
Command as AuthTokenCommand
|
||||||
from rest_framework.authtoken.models import Token
|
from rest_framework.authtoken.models import Token
|
||||||
from rest_framework.authtoken.serializers import AuthTokenSerializer
|
from rest_framework.authtoken.serializers import AuthTokenSerializer
|
||||||
from rest_framework.exceptions import ValidationError
|
|
||||||
|
|
||||||
|
|
||||||
class AuthTokenTests(TestCase):
|
class AuthTokenTests(TestCase):
|
||||||
|
@ -28,10 +27,6 @@ class AuthTokenTests(TestCase):
|
||||||
def test_token_string_representation(self):
|
def test_token_string_representation(self):
|
||||||
assert str(self.token) == 'test token'
|
assert str(self.token) == 'test token'
|
||||||
|
|
||||||
def test_validate_raise_error_if_no_credentials_provided(self):
|
|
||||||
with pytest.raises(ValidationError):
|
|
||||||
AuthTokenSerializer().validate({})
|
|
||||||
|
|
||||||
def test_whitespace_in_password(self):
|
def test_whitespace_in_password(self):
|
||||||
data = {'username': self.user.username, 'password': 'test pass '}
|
data = {'username': self.user.username, 'password': 'test pass '}
|
||||||
self.user.set_password(data['password'])
|
self.user.set_password(data['password'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user