def test_method_get_instance(self): """Location instance get single location by primary key""" location = Location.get(TEST_LOCATION) # make sure one location is returned self.assertIsInstance(location, Location)
def validate(self): try: location = Location.get(self.code) except LocationError as e: raise ActionError( 'Could not determine location from code: "{c}"'.\ format(c=self.code) ) self._location = location
def _validate_location(self): # ---- make sure code and server are valid # first, set the server value in the environment server_var = DpaVars.data_server() server_var.value = self.server server_var.set() # now query the location code try: location = Location.get(self.code) except ActionError as e: raise ActionError( "Unable to verify location: " + self.code + "\n" + str(e) ) return location
def setUp(self): """Get a new location object for each test.""" self.location = Location.get(TEST_LOCATION)
def location(self): """:returns: Location that owns this version.""" return Location.get(self.location_code)
def location(self): return Location.get(self.location_code)
def creation_location(self): return Location.get(self.creation_location_code)