'Tests creation of bookmark.'

def test_create_bookmark_success(self):

    bookmark_data = self.get_bookmark_data(self.vertical_2)
    (bookmark, __) = Bookmark.create(bookmark_data)
    self.assert_bookmark_model_is_valid(bookmark, bookmark_data)
    bookmark_data_different_values = self.get_bookmark_data(self.vertical_2)
    bookmark_data_different_values['display_name'] = 'Introduction    Video'
    (bookmark2, __) = Bookmark.create(bookmark_data_different_values)
    self.assertEqual(bookmark, bookmark2)
    self.assertEqual(bookmark.xblock_cache, bookmark2.xblock_cache)
    self.assert_bookmark_model_is_valid(bookmark2, bookmark_data)
    bookmark_data_different_user = self.get_bookmark_data(self.vertical_2)
    bookmark_data_different_user['user'] = UserFactory.create()
    (bookmark3, __) = Bookmark.create(bookmark_data_different_user)
    self.assertNotEqual(bookmark, bookmark3)
    self.assert_bookmark_model_is_valid(bookmark3, bookmark_data_different_user)
