def test_copy(self): kw = Keyword(name='Keyword') copy = kw.copy() assert_equal(kw.name, copy.name) copy.name += ' copy' assert_not_equal(kw.name, copy.name) assert_equal(id(kw.tags), id(copy.tags))
def test_copy_with_attributes(self): kw = Keyword(name='Orig', doc='Orig', tags=['orig']) copy = kw.copy(name='New', doc='New', tags=['new']) assert_equal(copy.name, 'New') assert_equal(copy.doc, 'New') assert_equal(list(copy.tags), ['new'])