def test_edxnotes_tab_with_feature_flag(self, enable_edxnotes): """ Verify EdxNotesTab visibility when ENABLE_EDXNOTES feature flag is enabled/disabled. """ FEATURES['ENABLE_EDXNOTES'] = enable_edxnotes with override_settings(FEATURES=FEATURES): self.assertEqual(EdxNotesTab.is_enabled(self.course), enable_edxnotes)
def test_edxnotes_tab_with_harvard_notes(self, harvard_notes_enabled): """ Verify EdxNotesTab visibility when harvard notes feature is enabled/disabled. """ with patch("edxnotes.plugins.is_harvard_notes_enabled") as mock_harvard_notes_enabled: mock_harvard_notes_enabled.return_value = harvard_notes_enabled self.assertEqual(EdxNotesTab.is_enabled(self.course), not harvard_notes_enabled)
def test_edxnotes_tab_with_harvard_notes(self, harvard_notes_enabled): """ Verify EdxNotesTab visibility when harvard notes feature is enabled/disabled. """ with patch("edxnotes.plugins.is_harvard_notes_enabled") as mock_harvard_notes_enabled: mock_harvard_notes_enabled.return_value = harvard_notes_enabled assert EdxNotesTab.is_enabled(self.course, self.user) == (not harvard_notes_enabled)
def test_edxnotes_tab_with_feature_flag(self, enabled): """ Verify EdxNotesTab visibility when ENABLE_EDXNOTES feature flag is enabled/disabled. """ FEATURES['ENABLE_EDXNOTES'] = enabled with override_settings(FEATURES=FEATURES): assert EdxNotesTab.is_enabled(self.course, self.user) == enabled
def is_feature_enabled(course, user): """ Returns True if Student Notes feature is enabled for the course, False otherwise. """ return EdxNotesTab.is_enabled(course, user)
def is_feature_enabled(course): """ Returns True if Student Notes feature is enabled for the course, False otherwise. """ return EdxNotesTab.is_enabled(course)
def test_edxnotes_tab_with_unauthorized_user(self): """ Verify EdxNotesTab visibility when user is unauthroized. """ user = UserFactory.create(username="******", email="*****@*****.**", password="******") self.assertFalse(EdxNotesTab.is_enabled(self.course, user=user))
def test_edxnotes_tab_with_unenrolled_user(self): user = UserFactory() assert not EdxNotesTab.is_enabled(self.course, user=user)