Skip to content

Commit

Permalink
Adding unit tests of encryption fields
Browse files Browse the repository at this point in the history
  • Loading branch information
john-westcott-iv committed Jan 12, 2024
1 parent be89c7a commit c101ee6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ansible_base/tests/unit/models/test_common.py
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()

0 comments on commit c101ee6

Please sign in to comment.