forked from ansible/django-ansible-base
-
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.
Adding unit tests of encryption fields
- Loading branch information
1 parent
be89c7a
commit c101ee6
Showing
1 changed file
with
19 additions
and
0 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,19 @@ | ||
import pytest | ||
|
||
from test_app.models import EncryptionModel | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_save_encryption(): | ||
model = EncryptionModel.objects.create(testing1='c') | ||
model.save() | ||
|
||
saved_model = EncryptionModel.objects.first() | ||
assert saved_model.testing2 == 'b' | ||
assert saved_model.testing1 == 'c' | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_name_in_summary_fields(): | ||
model = EncryptionModel.objects.create() | ||
assert 'name' in model.summary_fields() |