-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0f8382
commit 5db9f25
Showing
4 changed files
with
27 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from django.db import connections | ||
from django.test import TransactionTestCase | ||
|
||
from api.models import DataItem, Dataset, FieldLevelCheck, ProgressMonitorDataset | ||
|
||
|
||
class TestCase(TransactionTestCase): | ||
databases = {"default", "data"} | ||
unmanaged = {DataItem, Dataset, FieldLevelCheck, ProgressMonitorDataset} | ||
|
||
def setUp(self): | ||
with connections["data"].schema_editor() as schema_editor: | ||
for model in self.unmanaged: | ||
schema_editor.create_model(model) | ||
|
||
def tearDown(self): | ||
with connections["data"].schema_editor() as schema_editor: | ||
for model in self.unmanaged: | ||
schema_editor.delete_model(model) | ||
|
||
def create(self, model, **kwargs): | ||
obj = model(**kwargs) | ||
obj.full_clean() | ||
obj.save() | ||
return obj |
File renamed without changes.
Empty file.
25 changes: 2 additions & 23 deletions
25
backend/tests/processor/test_views.py → backend/tests/controller/test_views.py
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