diff -r 150033493bce src-test/src/org/openbravo/test/xml/UniqueConstraintImportTest.java
--- a/src-test/src/org/openbravo/test/xml/UniqueConstraintImportTest.java	Mon Jan 23 11:26:31 2017 +0100
+++ b/src-test/src/org/openbravo/test/xml/UniqueConstraintImportTest.java	Sun Jan 29 19:46:12 2017 +0100
@@ -63,7 +63,7 @@
   @Test
   public void testACreateCountryTrl() {
     setSystemAdministratorContext();
-    final Country country = getCountry("Norway");
+    final Country country = getCountryByCode("NO");
     final OBCriteria<CountryTrl> obc = OBDal.getInstance().createCriteria(CountryTrl.class);
     obc.add(Restrictions.eq("country", country));
     final List<CountryTrl> countryTrls = obc.list();
@@ -104,7 +104,7 @@
     setTestAdminContext();
 
     // read countrytrl
-    String xml = exportClass(CountryTrl.class, "country", getCountry("Norway"));
+    String xml = exportClass(CountryTrl.class, "country", getCountryByCode("NO"));
 
     // change the id
     xml = xml.replaceAll("<CountryTrl id=\"..", "<CountryTrl id=\"1k");
@@ -129,10 +129,11 @@
     }
   }
 
-  private Country getCountry(String name) {
+  private Country getCountryByCode(String name) {
     final OBCriteria<Country> obc = OBDal.getInstance().createCriteria(Country.class);
-    obc.add(Restrictions.eq("name", name));
-    return obc.list().get(0);
+    // has unique constraint
+    obc.add(Restrictions.eq("iSOCountryCode", name));
+    return (Country) obc.uniqueResult();
   }
 
   private <T extends BaseOBObject> String exportClass(Class<T> clz, String field, Object value) {
