'Left Join for a super-component'

def testGetLeftJoinSuperComponent(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    resource = current.s3db.resource('pr_person')
    component = resource.components['contact']
    rtable = resource.table
    ctable = component.table
    expected = ctable.on(((rtable.pe_id == ctable.pe_id) & (ctable.deleted != True)))
    ljoin = component.get_left_join()
    assertTrue(isinstance(ljoin, list))
    assertEqual(len(ljoin), 1)
    assertEqual(str(ljoin[0]), str(expected))
