'Test merge of single-component'

def testMergeSingleComponent(self):

    assertEqual = self.assertEqual
    assertNotEqual = self.assertNotEqual
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    db = current.db
    s3db = current.s3db
    deployment_settings = current.deployment_settings
    (person1, person2) = self.get_records()
    dtable = s3db.pr_physical_description
    pd1 = Storage(pe_id=person1.pe_id, blood_type='B+')
    pd1_id = dtable.insert(**pd1)
    pd1.update(id=pd1_id)
    s3db.update_super(dtable, pd1)
    pd2 = Storage(pe_id=person2.pe_id, blood_type='B-')
    pd2_id = dtable.insert(**pd2)
    pd2.update(id=pd2_id)
    s3db.update_super(dtable, pd2)
    success = self.resource.merge(self.id1, self.id2, replace=['physical_description.blood_type'])
    assertTrue(success)
    pd1 = db((dtable._id == pd1_id)).select(limitby=(0, 1)).first()
    assertNotEqual(pd1, None)
    assertFalse(pd1.deleted)
    assertEqual(pd1.blood_type, 'B-')
    assertEqual(pd1.pe_id, person1.pe_id)
    pd2 = db((dtable._id == pd2_id)).select(limitby=(0, 1)).first()
    assertNotEqual(pd2, None)
    assertTrue(pd2.deleted)
    assertEqual(str(pd2.deleted_rb), str(pd1.id))
