aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/manage.py
diff options
context:
space:
mode:
authorJocelynDelalande <JocelynDelalande@users.noreply.github.com>2018-01-07 00:27:42 +0100
committerAlexis Metaireau <alexis@notmyidea.org>2018-01-07 00:27:42 +0100
commit2019b398f164aa3f7edb8af439c92f1a32d2e920 (patch)
tree53f839f424f79d34c319c42b74f69fc6076fc470 /ihatemoney/manage.py
parent3b2e11ab6369dfa853383840dc28915b60c2d062 (diff)
downloadihatemoney-mirror-2019b398f164aa3f7edb8af439c92f1a32d2e920.zip
ihatemoney-mirror-2019b398f164aa3f7edb8af439c92f1a32d2e920.tar.gz
ihatemoney-mirror-2019b398f164aa3f7edb8af439c92f1a32d2e920.tar.bz2
manage commands testing (#313)
* Rename manage.ConfigTemplate → manage.GenerateConfig To be consistent with the CLI name: `generate-config`. * Add tests for manage.py commands * Run tests from pip-installed package To be able to detect packaging-related issues on test runs. refs #305
Diffstat (limited to 'ihatemoney/manage.py')
-rwxr-xr-xihatemoney/manage.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ihatemoney/manage.py b/ihatemoney/manage.py
index 797e6c4..315cfac 100755
--- a/ihatemoney/manage.py
+++ b/ihatemoney/manage.py
@@ -4,7 +4,7 @@ import os
import pkgutil
import random
import sys
-from getpass import getpass
+import getpass
from flask_script import Manager, Command, Option
from flask_migrate import Migrate, MigrateCommand
@@ -20,11 +20,11 @@ class GeneratePasswordHash(Command):
"""Get password from user and hash it without printing it in clear text."""
def run(self):
- password = getpass(prompt='Password: ')
+ password = getpass.getpass(prompt='Password: ')
print(generate_password_hash(password))
-class ConfigTemplate(Command):
+class GenerateConfig(Command):
def get_options(self):
return [
Option('config_file', choices=[
@@ -74,7 +74,7 @@ def main():
manager = Manager(app)
manager.add_command('db', MigrateCommand)
manager.add_command('generate_password_hash', GeneratePasswordHash)
- manager.add_command('generate-config', ConfigTemplate)
+ manager.add_command('generate-config', GenerateConfig)
manager.run()