'Test to get all the certificates for a user'

def test_get_certificates_for_user(self):

    certs = certs_api.get_certificates_for_user(self.student.username)
    self.assertEqual(len(certs), 2)
    self.assertEqual(certs[0]['username'], self.student.username)
    self.assertEqual(certs[1]['username'], self.student.username)
    self.assertEqual(certs[0]['course_key'], self.web_cert_course.id)
    self.assertEqual(certs[1]['course_key'], self.pdf_cert_course.id)
    self.assertEqual(certs[0]['created'], self.now)
    self.assertEqual(certs[1]['created'], self.now)
    self.assertEqual(certs[0]['type'], CourseMode.VERIFIED)
    self.assertEqual(certs[1]['type'], CourseMode.HONOR)
    self.assertEqual(certs[0]['status'], CertificateStatuses.downloadable)
    self.assertEqual(certs[1]['status'], CertificateStatuses.downloadable)
    self.assertEqual(certs[0]['is_passing'], True)
    self.assertEqual(certs[1]['is_passing'], True)
    self.assertEqual(certs[0]['grade'], '0.88')
    self.assertEqual(certs[1]['grade'], '0.99')
    self.assertEqual(certs[0]['download_url'], 'www.google.com')
    self.assertEqual(certs[1]['download_url'], 'www.gmail.com')
