#NEWLINE# def test_copy_page_with_m2m_relations( self ) : #NEWLINE# #INDENT# event_index = Page . objects . get ( url_path = '/home/events/' ) #NEWLINE# category = BlogCategory . objects . create ( name = 'Birds' ) #NEWLINE# advert = Advert . objects . create ( url = 'http://www.heinz.com/' , text = 'beanz meanz heinz' ) #NEWLINE# blog_page = ManyToManyBlogPage ( title = 'My blog page' , slug = 'my-blog-page' ) #NEWLINE# event_index . add_child ( instance = blog_page ) #NEWLINE# blog_page . adverts . add ( advert ) #NEWLINE# BlogCategoryBlogPage . objects . create ( category = category , page = blog_page ) #NEWLINE# blog_page . save_revision ( ) . publish ( ) #NEWLINE# homepage = Page . objects . get ( url_path = '/home/' ) #NEWLINE# new_blog_page = blog_page . copy ( to = advert ) #NEWLINE# self . assertNotEqual ( blog_page . id , new_blog_page . id )