'copying a user with \'parent_id\' in defaults should not duplicate the partner'

@mute_logger('odoo.models')
def test_copy_with_ancestor(self):

    user_foo = self.env['res.users'].create({'name': 'Foo', 'login': 'foo', 'password': 'foo', 'login_date': '2016-01-01', 'signature': 'XXX'})
    partner_bar = self.env['res.partner'].create({'name': 'Bar'})
    (foo_before,) = user_foo.read()
    del foo_before['__last_update']
    del foo_before['login_date']
    partners_before = self.env['res.partner'].search([])
    user_bar = user_foo.copy({'partner_id': partner_bar.id, 'login': 'bar'})
    (foo_after,) = user_foo.read()
    del foo_after['__last_update']
    del foo_after['login_date']
    partners_after = self.env['res.partner'].search([])
    self.assertEqual(foo_before, foo_after)
    self.assertEqual(partners_before, partners_after)
    self.assertNotEqual(user_foo.id, user_bar.id)
    self.assertEqual(user_bar.partner_id.id, partner_bar.id)
    self.assertEqual(user_bar.login, 'bar', 'login    is    given    from    copy    parameters')
    self.assertFalse(user_bar.password, 'password    should    not    be    copied    from    original    record')
    self.assertEqual(user_bar.name, 'Bar', 'name    is    given    from    specific    partner')
    self.assertEqual(user_bar.signature, user_foo.signature, 'signature    should    be    copied')
