mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-11-21 23:58:02 +01:00
Add update-fixtures task
This commit is contained in:
parent
a9599d504d
commit
2cc62ed455
1 changed files with 20 additions and 0 deletions
20
tasks.py
20
tasks.py
|
@ -86,3 +86,23 @@ def download_db(ctx: Context) -> None:
|
|||
ctx.run("scp -r ubuntu:/mnt/data/checkout/media/ ./src/media")
|
||||
with ctx.cd(SRC_DIR):
|
||||
ctx.run("./manage.py changepassword gaugendre", pty=True)
|
||||
|
||||
|
||||
@task
|
||||
def update_fixtures(ctx: Context) -> None:
|
||||
with ctx.cd(SRC_DIR):
|
||||
ctx.run(
|
||||
"./manage.py dumpdata purchase.Product purchase.ProductCategory --natural-primary --natural-foreign -o ./purchase/fixtures/products.json",
|
||||
echo=True,
|
||||
pty=True,
|
||||
)
|
||||
ctx.run(
|
||||
"./manage.py dumpdata purchase.PaymentMethod --natural-primary --natural-foreign -o ./purchase/fixtures/payment_methods.json",
|
||||
echo=True,
|
||||
pty=True,
|
||||
)
|
||||
ctx.run(
|
||||
"pre-commit run --files ./purchase/fixtures/products.json ./purchase/fixtures/payment_methods.json",
|
||||
echo=True,
|
||||
pty=True,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue