Пример #1
0
def test_user_register_serializer_errors():

    data = {
        'username': '',
        'email': '*****@*****.**',
    }

    s = UserRegisterSerializer(data=data)
    s.is_valid()

    assert unicode(s.fields['username'].error_messages['blank']) \
        in s.errors['username']
    assert unicode(s.fields['password'].error_messages['required']) \
        in s.errors['password']
Пример #2
0
def test_user_register_serializer_errors():

    data = {
        'username': '',
        'email': '*****@*****.**',
    }

    s = UserRegisterSerializer(data=data)
    s.is_valid()

    assert unicode(s.fields['username'].error_messages['blank']) \
        in s.errors['username']
    assert unicode(s.fields['password'].error_messages['required']) \
        in s.errors['password']
Пример #3
0
def test_user_register_serializer():

    data = {
        'username': '******',
        'email': '*****@*****.**',
        'password': '******'
    }

    serializer = UserRegisterSerializer(data=data)
    assert serializer.is_valid()
Пример #4
0
def test_user_register_serializer():

    data = {
        'username': '******',
        'email': '*****@*****.**',
        'password': '******'
    }

    serializer = UserRegisterSerializer(data=data)
    assert serializer.is_valid()