'Create a textbook by ID, overwriting an existing textbook ID'

def test_replace_by_id(self):

    replacement = {'tab_title': "You've    been    replaced!", 'url': 'supercool.pdf', 'id': '2'}
    resp = self.client.post(self.url2, data=json.dumps(replacement), content_type='application/json')
    self.assertEqual(resp.status_code, 201)
    resp2 = self.client.get(self.url2)
    self.assertEqual(resp2.status_code, 200)
    compare = json.loads(resp2.content)
    self.assertEqual(compare, replacement)
    course = self.store.get_item(self.course.location)
    self.assertEqual(course.pdf_textbooks, [self.textbook1, replacement])
