-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests now passing, after a bit of an sql-reactor
- Loading branch information
1 parent
027bc5b
commit b590724
Showing
7 changed files
with
187 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Generated by Django 4.2 on 2024-06-30 11:57 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import hordak.utilities.db | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("hordak", "0048_hordak_transaction_view"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="TransactionView", | ||
fields=[ | ||
( | ||
"parent", | ||
models.OneToOneField( | ||
db_column="id", | ||
editable=False, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
primary_key=True, | ||
related_name="view", | ||
serialize=False, | ||
to="hordak.transaction", | ||
), | ||
), | ||
("uuid", models.UUIDField(editable=False, verbose_name="uuid")), | ||
( | ||
"timestamp", | ||
models.DateTimeField( | ||
editable=False, | ||
help_text="The creation date of this transaction object", | ||
verbose_name="timestamp", | ||
), | ||
), | ||
( | ||
"date", | ||
models.DateField( | ||
editable=False, | ||
help_text="The date on which this transaction occurred", | ||
verbose_name="date", | ||
), | ||
), | ||
( | ||
"description", | ||
models.TextField(editable=False, verbose_name="description"), | ||
), | ||
( | ||
"amount", | ||
hordak.utilities.db.BalanceField( | ||
editable=False, | ||
help_text="The total amount transferred in this transaction", | ||
), | ||
), | ||
( | ||
"credit_account_ids", | ||
models.JSONField( | ||
editable=False, | ||
help_text="List of account ids for the credit legs of this transaction", | ||
), | ||
), | ||
( | ||
"debit_account_ids", | ||
models.JSONField( | ||
editable=False, | ||
help_text="List of account ids for the debit legs of this transaction", | ||
), | ||
), | ||
( | ||
"credit_account_names", | ||
models.JSONField( | ||
editable=False, | ||
help_text="List of account names for the credit legs of this transaction", | ||
), | ||
), | ||
( | ||
"debit_account_names", | ||
models.JSONField( | ||
editable=False, | ||
help_text="List of account names for the debit legs of this transaction", | ||
), | ||
), | ||
], | ||
options={ | ||
"db_table": "hordak_transaction_view", | ||
"managed": False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from unittest import skip | ||
|
||
from django.db import connection | ||
|
||
|
||
def _id(obj): | ||
return obj | ||
|
||
|
||
def postgres_only(reason="Test is postgresql-specific"): | ||
if not connection.vendor == "postgresql": | ||
return skip(reason) | ||
return _id | ||
|
||
|
||
def mysql_only(reason="Test is postgresql-specific"): | ||
if not connection.vendor == "mysql": | ||
return skip(reason) | ||
return _id |