'Make sure the proper badges are awarded at the right checkpoints.'

@unpack
@data((1, 2), (2, 6), (3, 9))
def test_checkpoint_matches(self, checkpoint, required_badges):

    user = UserFactory()
    courses = [CourseFactory() for _i in range(required_badges)]
    for course in courses:
        GeneratedCertificate(user=user, course_id=course.location.course_key, status=CertificateStatuses.downloadable).save()
    assertions = user.badgeassertion_set.all().order_by('id')
    self.assertEqual(user.badgeassertion_set.all().count(), checkpoint)
    self.assertEqual(assertions[(checkpoint - 1)].badge_class, self.badge_classes[(checkpoint - 1)])
