Merged the "init-db" console command to the Flask application initialization in the test site, to simplify the code.
This commit is contained in:
		@@ -71,10 +71,8 @@ class CurrencyTestCase(unittest.TestCase):
 | 
			
		||||
        runner: FlaskCliRunner = self.app.test_cli_runner()
 | 
			
		||||
        with self.app.app_context():
 | 
			
		||||
            from accounting.models import Currency, CurrencyL10n
 | 
			
		||||
            result: Result
 | 
			
		||||
            result = runner.invoke(args="init-db")
 | 
			
		||||
            self.assertEqual(result.exit_code, 0)
 | 
			
		||||
            result = runner.invoke(args=["accounting-init-db", "-u", "editor"])
 | 
			
		||||
            result: Result = runner.invoke(
 | 
			
		||||
                args=["accounting-init-db", "-u", "editor"])
 | 
			
		||||
            self.assertEqual(result.exit_code, 0)
 | 
			
		||||
            CurrencyL10n.query.delete()
 | 
			
		||||
            Currency.query.delete()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user