def test_financial_aid_for_user(self):
"""
Purchasable course runs must have a financial aid attached for the given user
"""
course_run, user = create_purchasable_course_run()
program = course_run.course.program
tier_program = program.tier_programs.first()
financial_aid = tier_program.financialaid_set.first()
financial_aid.user = UserFactory.create()
financial_aid.save()
with self.assertRaises(ValidationError) as ex:
get_purchasable_course_run(course_run.edx_course_key, user)
assert ex.exception.args[0] == (
"Course run {} does not have a current attached financial aid application".format(
course_run.edx_course_key
)
)
评论列表
文章目录