'Test that posting a bookmark for a block that does not exist returns a 400.'

@patch('django.conf.settings.MAX_BOOKMARKS_PER_COURSE', 5)
def test_post_bookmark_when_max_bookmarks_already_exist(self):

    max_bookmarks = settings.MAX_BOOKMARKS_PER_COURSE
    (__, blocks, __) = self.create_course_with_bookmarks_count(max_bookmarks)
    response = self.send_post(client=self.client, url=reverse('bookmarks'), data={'usage_id': unicode(blocks[(-1)].location)}, expected_status=400)
    self.assertEqual(response.data['user_message'], u'You    can    create    up    to    {0}    bookmarks.    You    must    remove    some    bookmarks    before    you    can    add    new    ones.'.format(max_bookmarks))
    self.assertEqual(response.data['developer_message'], u'You    can    create    up    to    {0}    bookmarks.    You    must    remove    some    bookmarks    before    you    can    add    new    ones.'.format(max_bookmarks))
