-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #203. Implemented hard delete for participant
- Loading branch information
Showing
4 changed files
with
126 additions
and
5 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
26 changes: 26 additions & 0 deletions
26
teraserver/python/tests/opentera/db/models/test_TeraParticipantGroup.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
from tests.opentera.db.models.BaseModelsTest import BaseModelsTest | ||
|
||
from opentera.db.models.TeraParticipantGroup import TeraParticipantGroup | ||
|
||
|
||
class TeraParticipantGroupTest(BaseModelsTest): | ||
|
||
def test_defaults(self): | ||
pass | ||
|
||
def test_soft_delete(self): | ||
with self._flask_app.app_context(): | ||
# Create a new participant group | ||
group = TeraParticipantGroup() | ||
group.participant_group_name = "Test participant group" | ||
group.id_project = 1 | ||
TeraParticipantGroup.insert(group) | ||
self.assertIsNotNone(group.id_participant_group) | ||
id_participant_group = group.id_participant_group | ||
|
||
# Delete participant group | ||
TeraParticipantGroup.delete(id_participant_group) | ||
# Make sure participant group is deleted | ||
self.assertIsNone(TeraParticipantGroup.get_participant_group_by_id(id_participant_group)) | ||
|
||
# Query, with soft delete flag | ||
group = TeraParticipantGroup.query.filter_by(id_participant_group=id_participant_group) \ | ||
.execution_options(include_deleted=True).first() | ||
self.assertIsNotNone(group) | ||
self.assertIsNotNone(group.deleted_at) | ||
|
||
def test_hard_delete(self): | ||
pass |