def test_error_when_chat_validation_not_passed(include_param): user_params = {"user_huid", "ad_login", "ad_domain", "username"} builder = MessageBuilder() builder.body = "system:chat_created" builder.user = builder.user.copy( update={param: None for param in user_params - {include_param}}, ) builder.command_data = { "group_chat_id": uuid.uuid4(), "chat_type": "group_chat", "name": "", "creator": uuid.uuid4(), "members": [], } with pytest.raises(ValidationError): builder.system_command = True
def test_settings_new_user_for_message(incoming_message): builder = MessageBuilder() builder.user = incoming_message.user assert builder.user == incoming_message.user