feat: add django test command
Added django's manage.py test command as a shortcut
This commit is contained in:
parent
251826c048
commit
5d45eccfef
|
@ -31,4 +31,7 @@ pub enum Django {
|
||||||
|
|
||||||
/// Run Django's manage.py shell.
|
/// Run Django's manage.py shell.
|
||||||
Shell,
|
Shell,
|
||||||
|
|
||||||
|
/// Run Django's manage.py test.
|
||||||
|
Test,
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ fn main() -> Result<()> {
|
||||||
cli::Django::Manage { rest } => scripts::django::manage(&rest),
|
cli::Django::Manage { rest } => scripts::django::manage(&rest),
|
||||||
cli::Django::Migrate { rest } => scripts::django::migrate(&rest),
|
cli::Django::Migrate { rest } => scripts::django::migrate(&rest),
|
||||||
cli::Django::Shell => scripts::django::shell(),
|
cli::Django::Shell => scripts::django::shell(),
|
||||||
|
cli::Django::Test => scripts::django::test(),
|
||||||
},
|
},
|
||||||
cli::Commands::Postgres { command } => match command {
|
cli::Commands::Postgres { command } => match command {
|
||||||
cli::Postgres::Import { path } => scripts::postgres::import(&path),
|
cli::Postgres::Import { path } => scripts::postgres::import(&path),
|
||||||
|
|
|
@ -61,13 +61,17 @@ pub fn makemigrations() -> Result<()> {
|
||||||
manage(&["makemigrations".to_string()])
|
manage(&["makemigrations".to_string()])
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shell() -> Result<()> {
|
|
||||||
manage(&["shell".to_string()])
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn migrate(rest: &[String]) -> Result<()> {
|
pub fn migrate(rest: &[String]) -> Result<()> {
|
||||||
let mut full_rest = vec!["migrate".to_string()];
|
let mut full_rest = vec!["migrate".to_string()];
|
||||||
full_rest.extend_from_slice(rest);
|
full_rest.extend_from_slice(rest);
|
||||||
|
|
||||||
manage(&full_rest)
|
manage(&full_rest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn shell() -> Result<()> {
|
||||||
|
manage(&["shell".to_string()])
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn test() -> Result<()> {
|
||||||
|
manage(&["test".to_string()])
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue