Merge pull request #3785 from modoboa/fix/import-csv-command-line

Fixed wrong import command parameter name
This commit is contained in:
Antoine Nguyen
2025-11-07 17:02:57 +01:00
committed by GitHub
3 changed files with 10 additions and 1 deletions
@@ -35,7 +35,7 @@ class ImportCommand(BaseCommand):
help="Continue even if an entry already exists.",
)
parser.add_argument(
"--crypt-password",
"--crypt-passwords",
action="store_true",
default=False,
help="Encrypt provided passwords.",
@@ -0,0 +1 @@
account; user1@test.com; toto; User; One; True; SimpleUsers; user1@test.com; 0
1 account user1@test.com toto User One True SimpleUsers user1@test.com 0
+8
View File
@@ -328,3 +328,11 @@ alias; alias1@test.com; True; user1@test.com
self.assertTrue(ex_message.startswith("Object already exists"))
call_command("modo", "import", "--continue-if-exists", test_file)
def test_import_accounts(self):
test_file = os.path.join(
os.path.dirname(__file__), "test_data/import_accounts.csv"
)
call_command("modo", "import", "--crypt-passwords", test_file)
user = User.objects.get(username="user1@test.com")
self.assertTrue(user.check_password("toto"))