def test_user_get_by_update_without_surname(telegram_update_without_surname): update = telegram_update_without_surname() user = user_get_by_update(update) assert isinstance(user, User) assert user.chat_id == 246225 assert user.user_name == 'username' assert user.full_name == 'Vadim'
def test_user_get_by_update_without_surname(telegram_update_without_surname): update = telegram_update_without_surname() user = user_get_by_update(update) assert isinstance(user, User) assert user.chat_id == 98765432 assert user.user_name == 'username' assert user.full_name == 'GlobBlob'
def test_user_get_by_update_empty(telegram_update): update = telegram_update(message='Um, hi!') user = user_get_by_update(update) assert isinstance(user, User) assert user.chat_id == 383716 assert user.user_name == 'hemantic' assert user.full_name == 'Артём Киселёв'
def test_user_get_by_update_empty(telegram_update): update = telegram_update(message='Um, hi!') user = user_get_by_update(update) assert isinstance(user, User) assert user.chat_id == 987654321 assert user.user_name == 'vasisualiy_is_my_name' assert user.full_name == 'Акакий Акакиевич'
def test_user_get_by_update_username_changed(telegram_update): User(chat_id='383716', user_name='dummy', full_name='John Doe').save() update = telegram_update() user = user_get_by_update(update) assert isinstance(user, User) assert user.chat_id == 383716 assert user.user_name == 'hemantic'