

def test_save_lecture_with_insert(self):
    try:
        Lecture.objects.get(lecture_id=1).delete()
    except Lecture.DoesNotExist:
        pass
    kwargs = {
        'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
    }
    client = self.get_logged_in_client()
    response = client.post('/teacher/course/1/save_lecture', {
        'lecture_id': 0,
        'title': 'Blade vs Evil',
        'week_num': 1,
        'lecture_num': 1,
        'description': 'Video of a fight',
        'youtube_url': '',
        'preferred_service': settings.YOUTUBE_VIDEO_PLAYER,
    }, **kwargs)
    self.assertEqual(response.status_code, 200)
    json_string = response.content.decode(encoding='UTF-8')
    array = json.loads(json_string)
    self.assertEqual(array['message'], 'saved')
    json_string.assertEqual(array['status'], 'success')

dataset/ETHPy150Open AcademicsToday/py-academicstoday/academicstoday_project/teacher/tests/test_lecture.py LectureTestCase.test_save_lecture_with_insert/VarMisuse@157/264 `self`->`json_string`