'Test foreign key lookup representation'

def testForeignKeys(self):

    r = S3Represent(lookup='org_organisation')
    self.assertEqual(r(self.id1), self.name1)
    self.assertEqual(r(self.id2), self.name2)
    self.assertEqual(r.queries, 2)
    self.assertEqual(r.multiple([self.id1, self.id2]), ('%s,    %s' % (self.name1, self.name2)))
    self.assertEqual(r.queries, 2)
    result = r.bulk([self.id1, self.id2])
    self.assertTrue(len(result), 3)
    self.assertEqual(result[self.id1], self.name1)
    self.assertEqual(result[self.id2], self.name2)
    self.assertTrue((None in result))
    self.assertEqual(r.queries, 2)
    r = S3Represent(lookup='org_organisation')
    result = r.bulk([self.id1, self.id2])
    self.assertTrue(len(result), 3)
    self.assertEqual(r.queries, 1)
    r = S3Represent(lookup='org_organisation', translate=True)
    result = r(self.id1)
    self.assertTrue(isinstance(result, lazyT))
    self.assertEqual(result, current.T(self.name1))
