Skip to content

Commit

Permalink
fix: some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas12091101 committed Feb 15, 2024
1 parent 8ea39d3 commit faeb281
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions edx_sga/tests/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,12 @@ def make_one(self, display_name=None, **kw):
Creates a XBlock SGA for testing purpose.
"""
field_data = DictFieldData(kw)
# block = StaffGradedAssignmentXBlock(self.runtime, field_data, self.scope_ids)
mixologist = Mixologist(settings.XBLOCK_MIXINS)
class_ = mixologist.mix(StaffGradedAssignmentXBlock)
block = class_(self.runtime, field_data, self.scope_ids)
runtime = TestRuntime(services={'field-data': KvsFieldData(kvs=DictKeyValueStore())})
def_id = runtime.id_generator.create_definition("sga")
block.location = BlockUsageLocator(CourseLocator("SGAU","SGA101","course"), "sga", def_id)
# block.xmodule_runtime = self.runtime
# block.course_id = self.course_id
# block.category = "problem"

if display_name:
block.display_name = display_name
Expand Down Expand Up @@ -162,7 +158,6 @@ def make_student(self, block, name, make_state=True, **state):
module.save()

anonymous_id = anonymous_id_for_user(user, self.course_id)

item = StudentItem(
student_id=anonymous_id,
course_id=self.course_id,
Expand All @@ -178,7 +173,6 @@ def make_student(self, block, name, make_state=True, **state):
submissions_api.set_score(
submission["uuid"], score, block.max_score()
)

else:
submission = None

Expand All @@ -200,7 +194,6 @@ def personalize(self, block, module, item, submission):
state = json.loads(student_module.state)
for key, value in state.items():
setattr(block, key, value)

self.runtime.deprecated_anonymous_student_id = item.student_id

def test_ctor(self):
Expand Down Expand Up @@ -947,19 +940,6 @@ def test_runtime_user_is_staff(self, is_staff):
)
assert self.block.runtime.user_is_staff is is_staff

# self.runtime, _ = render.get_module_system_for_user(
# staff if is_staff else User.objects.create(),
# self.student_data,
# block,
# course.id,
# mock.Mock(),
# mock.Mock(),
# mock.Mock(),
# course=course,
# )
# block = self.make_one()
# assert block.runtime_user_is_staff() is is_staff

@data(True, False)
def test_grace_period(self, has_grace_period):
block = self.make_one()
Expand Down Expand Up @@ -1080,12 +1060,6 @@ def test_export(

# If both are true the expected output should only have the attribute, since it took precedence
# and the attribute contents are broken XML
print(reformat_xml(content))
print(reformat_xml(
self.make_test_vertical(
expected_solution_attribute, expected_solution_element
)
))
assert reformat_xml(content) == reformat_xml(
self.make_test_vertical(
expected_solution_attribute, expected_solution_element
Expand Down

0 comments on commit faeb281

Please sign in to comment.