def test_query_key_with_language(self): self.client = Client(application_key='') self.client.api_language = 'de' query = Query(self.client, self.resource) key = query.query_key(1) expected = '{}:1:de'.format(self.resource_name) self.assertEqual(key, expected) # Unsetting the language should also remove it from the key self.client.api_language = None key = query.query_key(1) expected = '{}:1'.format(self.resource_name) self.assertEqual(key, expected)
def test_query_key_with_language(self): self.client = Client(application_key='') self.client.api_language = 'de' query = Query(self.client, self.resource) key = query.query_key(1) expected = '{}:1:de'.format(self.resource_name) self.assertEqual(key, expected) # Unsetting the language should also remove it from the key self.client.api_language = None key = query.query_key(1) expected = '{}:1'.format(self.resource_name) self.assertEqual(key, expected)
def test_query_key_no_resource_id(self): query = Query(self.client, self.resource) key = query.query_key() self.assertEqual(key, self.resource_name)
def test_query_key_with_variation_id(self): query = Query(self.client, self.resource) key = query.query_key(1, 2) expected = '{}:1:2:test'.format(self.resource_name) self.assertEqual(key, expected)
def test_query_key_no_resource_id(self): query = Query(self.client, self.resource) key = query.query_key() self.assertEqual(key, self.resource_name)
def test_query_key_with_variation_id(self): query = Query(self.client, self.resource) key = query.query_key(1, 2) expected = '{}:1:2:test'.format(self.resource_name) self.assertEqual(key, expected)