def test_two_users_with_same_email(user, mixer): mixer.blend('users.User', email=user.email) created = UserCreator(name='Камаз Отходов', email=user.email)() created.refresh_from_db() assert created == user
def test(): created = UserCreator(name='Рулон Обоев', email='*****@*****.**')() created.refresh_from_db() assert created.first_name == 'Рулон' assert created.last_name == 'Обоев' assert created.email == '*****@*****.**'
def test_storing_wants_to_subscribe_flag(wants_to_subscribe): created = UserCreator(name='Рулон Обоев', email='*****@*****.**', subscribe=wants_to_subscribe)() created.refresh_from_db() assert created.subscribed is wants_to_subscribe
def test_empty_email(): created = UserCreator(name='Рулон Обоев', email='')() created.refresh_from_db() assert created.first_name == 'Рулон' assert created.last_name == 'Обоев' assert created.email == '' assert len(created.username) > 0
def test_empty_name(name): created = UserCreator(name=name, email='*****@*****.**')() created.refresh_from_db() assert created.first_name == '' assert created.last_name == '' assert created.email == '*****@*****.**' assert created.username == '*****@*****.**'
def test_existing_user_name_does_not_change(user): created = UserCreator(name='Камаз Отходов', email=user.email)() created.refresh_from_db() assert created.first_name == user.first_name assert created.last_name == user.last_name assert created.first_name != 'Камаз' assert created.last_name != 'Отходов'
def test_existing_user(user): created = UserCreator(name='Камаз Отходов', email=user.email)() created.refresh_from_db() assert created == user