From 1ec08701d2532b6796a2254413f7ef86bd452aca Mon Sep 17 00:00:00 2001 From: Cali Stenson Date: Wed, 7 Nov 2018 14:26:47 -0500 Subject: [PATCH] Add LTI problem type tests on content gating. REV-492 --- .../content_type_gating/tests/test_access.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/openedx/features/content_type_gating/tests/test_access.py b/openedx/features/content_type_gating/tests/test_access.py index 45ea732406..b4860b4229 100644 --- a/openedx/features/content_type_gating/tests/test_access.py +++ b/openedx/features/content_type_gating/tests/test_access.py @@ -70,6 +70,19 @@ class TestProblemTypeAccess(SharedModuleStoreTestCase): category='vertical', display_name='Lesson 1 Vertical - Unit 1' ) + self.lti_block = ItemFactory.create( + parent=self.vertical, + category='lti_consumer', + display_name='lti_consumer', + has_score=True, + graded=True, + ) + self.lti_block_not_scored = ItemFactory.create( + parent=self.vertical, + category='lti_consumer', + display_name='lti_consumer_2', + has_score=False, + ) self.problem_dict = {} for prob_type in self.PROBLEM_TYPES: block = ItemFactory.create( @@ -128,6 +141,15 @@ class TestProblemTypeAccess(SharedModuleStoreTestCase): # check that has_access did not raise the IncorrectPartitionGroupError thereby not gating the block self.assertFalse(mock_access_error.called) + def test_lti_audit_access(self): + """ + LTI stands for learning tools interoperability and is a 3rd party iframe that pulls in learning content from + outside sources. This tests that audit users cannot see LTI components with graded content but can see the LTI + components which do not have graded content. + """ + self.assert_block_is_gated(self.lti_block, True) + self.assert_block_is_gated(self.lti_block_not_scored, False) + @ddt.data( *PROBLEM_TYPES )