Skip to content

Commit

Permalink
Add lightweight test to confirm new key is in exported dict from a Note
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejalim committed Nov 16, 2023
1 parent d318b96 commit 3db4e59
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions nucleus/rna/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,34 @@ def test_distinct_recently_modified(self):
assert self.r2.version in versions
assert self.r3.version in versions
assert len(versions) == 2


class TestNote(TestCase):
def test_to_dict__simple__no_relations(self):
# Very simple test of the to_dict() method, mainly
# to prove that progressive_rollout is included
data = dict(
bug=1234,
note="Test note",
tag="this is a tag",
sort_num=1,
is_public=True,
progressive_rollout=True,
)

note = Note(**data)
note.save()

dumped_dict = note.to_dict()
for key in [
"bug",
"note",
"tag",
"sort_num",
"is_public",
"progressive_rollout",
]:
assert dumped_dict[key] == data[key]

assert "created" in dumped_dict
assert "modified" in dumped_dict

0 comments on commit 3db4e59

Please sign in to comment.