'test unenrolled user already not enrolled in a course.'

def test_unenrolled_already_not_enrolled_user(self):

    paid_course = self.create_paid_course()
    course_enrollment = CourseEnrollment.objects.filter(user__email=self.notregistered_email, course_id=paid_course.id)
    self.assertEqual(course_enrollment.count(), 0)
    url = reverse('students_update_enrollment', kwargs={'course_id': paid_course.id.to_deprecated_string()})
    params = {'identifiers': self.notregistered_email, 'action': 'unenroll', 'email_students': False, 'auto_enroll': False, 'reason': 'testing'}
    response = self.client.post(url, params)
    self.assertEqual(response.status_code, 200)
    expected = {'action': 'unenroll', 'auto_enroll': False, 'results': [{'identifier': self.notregistered_email, 'before': {'enrollment': False, 'auto_enroll': False, 'user': False, 'allowed': False}, 'after': {'enrollment': False, 'auto_enroll': False, 'user': False, 'allowed': False}}]}
    manual_enrollments = ManualEnrollmentAudit.objects.all()
    self.assertEqual(manual_enrollments.count(), 1)
    self.assertEqual(manual_enrollments[0].state_transition, UNENROLLED_TO_UNENROLLED)
    res_json = json.loads(response.content)
    self.assertEqual(res_json, expected)
