'Create a draft and publish it then modify the draft and check that published content is not modified'

def test_published_and_draft_contents_with_update(self):

    self.client.ajax_post(self.problem_update_url, data={'publish': 'make_public'})
    self._verify_published_with_no_draft(self.problem_usage_key)
    published = modulestore().get_item(self.problem_usage_key, revision=ModuleStoreEnum.RevisionOption.published_only)
    self.client.ajax_post(self.problem_update_url, data={'id': unicode(self.problem_usage_key), 'metadata': {}, 'data': '<p>Problem    content    draft.</p>'})
    draft = self.get_item_from_modulestore(self.problem_usage_key, verify_is_draft=True)
    self.assertNotEqual(draft.data, published.data)
    view_url = reverse_usage_url('xblock_view_handler', self.problem_usage_key, {'view_name': STUDENT_VIEW})
    resp = self.client.get(view_url, HTTP_ACCEPT='application/json')
    self.assertEqual(resp.status_code, 200)
    view_url = reverse_usage_url('xblock_view_handler', self.problem_usage_key, {'view_name': STUDIO_VIEW})
    resp = self.client.get(view_url, HTTP_ACCEPT='application/json')
    self.assertEqual(resp.status_code, 200)
    draft = self.get_item_from_modulestore(self.problem_usage_key, verify_is_draft=True)
    self.assertNotEqual(draft.data, published.data)
    published = modulestore().get_item(published.location, revision=ModuleStoreEnum.RevisionOption.published_only)
    self.assertNotEqual(draft.data, published.data)
