@Test
public void shouldgetLocationByOrgUnitCode() throws Exception {

	Location loc = new Location();
	loc.setName("testing");
	loc.setDescription("desc");
	loc.setAddress1("123");
	loc.setAddress1("456");
	loc.setCityVillage("city");
	loc.setStateProvince("state");
	loc.setCountry("country");
	loc.setPostalCode("post");
	loc.setLatitude("lat");
	loc.setLongitude("lon");
	LocationAttributeType attributetype = new LocationAttributeType();
	attributetype.setName("CODE");
	attributetype
			.setDescription("Corresponding Value of ORG UNITS for DHIS");
	attributetype.setMinOccurs(0);
	attributetype.setMaxOccurs(1);
	attributetype
			.setDatatypeClassname("org.openmrs.customdatatype.datatype.FreeTextDatatype");
	Context.getLocationService().saveLocationAttributeType(attributetype);
	LocationAttribute locationAttribute = new LocationAttribute();
	locationAttribute.setAttributeType(attributetype);
	locationAttribute.setValue("dhis2OrgUnitCode");
	loc.setAttribute(locationAttribute);
	Context.getLocationService().saveLocation(loc);
	Location l = dhis2ReportingService
			.getLocationByOrgUnitCode("dhis2OrgUnitCode");
	assertEquals(loc, l);
	assertTrue(loc.equals(l));
	assertEquals("testing", l.getName());
	assertEquals("country", l.getCountry());
}