mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Merge pull request #3785 from modoboa/fix/import-csv-command-line
Fixed wrong import command parameter name
This commit is contained in:
@@ -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
|
||||
|
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user