-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #429 from bounswe/entryClass
Entry Class Implementation
- Loading branch information
Showing
2 changed files
with
43 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,6 +411,28 @@ def test_theorem_model(self): | |
self.assertEqual(theorem.theorem_title, "Test Theorem") | ||
self.assertEqual(theorem.theorem_content, "This is a test theorem content.") | ||
|
||
class EntryModelTestCase(TestCase): | ||
def tearDown(self): | ||
Entry.objects.all().delete() | ||
print("All tests for the Entry Model are completed!") | ||
|
||
def test_entry_model(self): | ||
|
||
entry = Entry.objects.create( | ||
entry_id = 1, | ||
entry_index = 1, | ||
content = "This is an entry.", | ||
entry_date = "2023-11-11", | ||
is_theorem_entry = True, | ||
entry_number = 1, | ||
) | ||
self.assertEqual(entry.entry_id, 1) | ||
self.assertEqual(entry.entry_number, 1) | ||
self.assertEqual(entry.content, "This is an entry.") | ||
self.assertEqual(entry.entry_date, "2023-11-11") | ||
self.assertEqual(entry.is_theorem_entry, True) | ||
self.assertEqual(entry.is_final_entry,False) | ||
|
||
class ReviewRequestTestCase(TestCase): | ||
def tearDown(self): | ||
Workspace.objects.all().delete() | ||
|
@@ -458,6 +480,7 @@ def test_reject(self): | |
req = Request.objects.get(sender=self.contributor_sender) | ||
self.assertEqual(req.status, "R", "Reject method didn't work as expected") | ||
|
||
|
||
class RequestModelTestCase(TestCase): | ||
def tearDown(self): | ||
Request.objects.all().delete() | ||
|
@@ -472,6 +495,7 @@ def setUp(self): | |
) | ||
self.sender = Contributor.objects.create(user=sender_user, bio="Test bio 1") | ||
|
||
|
||
receiver_user = User.objects.create( | ||
username="testuser2", | ||
email="[email protected]", | ||
|