Skip to content

Commit

Permalink
remove testcase logic for versioning 2.0.0, as its not suggest to use
Browse files Browse the repository at this point in the history
  • Loading branch information
FreemanPancake committed Apr 25, 2024
1 parent fcf8c83 commit 8c3d6a4
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tests/test_monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ def test_get_edit_link(self, mock_is_obj_review_locked):
)
# We test that moderation check is called when getting an edit link
self.assertTrue(mock_is_obj_review_locked.called)
if versioning_version != "2.0.0":
# Edit link is inactive as `mock_is_obj_review_locked` is True
self.assertIn("inactive", edit_link)
else:
# Edit link is removed as `mock_is_obj_review_locked` is True
self.assertEqual("", edit_link)
# self.assertIn("inactive", edit_link)
self.assertIn("inactive", edit_link)

@mock.patch("djangocms_moderation.monkeypatch.is_registered_for_moderation")
@mock.patch("djangocms_moderation.monkeypatch.is_obj_review_locked")
Expand Down Expand Up @@ -92,12 +86,7 @@ def test_get_archive_link(self, _mock):
archive_link = ""
# We test that moderation check is called when getting an edit link
self.assertEqual(1, _mock.call_count)
if versioning_version != "2.0.0":
# Edit link is inactive as `mock_is_obj_review_locked` is True
self.assertIn("inactive", archive_link)
else:
# Edit link is unavailable
self.assertEqual("", archive_link)
self.assertIn("inactive", archive_link)

_mock.return_value = None
archive_link = self.version_admin._get_archive_link(version, self.mock_request)
Expand Down

0 comments on commit 8c3d6a4

Please sign in to comment.