Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #322 from zanata/rhbz1040717-clean-db
Browse files Browse the repository at this point in the history
rhbz1040717 - clean home page and help content between tests
  • Loading branch information
djansen-redhat committed Dec 16, 2013
2 parents 42454c1 + 2ab7398 commit 20297da
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -17,6 +17,7 @@
import org.zanata.model.HAccount;
import org.zanata.model.HAccountActivationKey;
import org.zanata.model.HAccountRole;
import org.zanata.model.HApplicationConfiguration;
import org.zanata.model.HDocument;
import org.zanata.model.HGlossaryEntry;
import org.zanata.model.HGlossaryTerm;
Expand All @@ -33,6 +34,7 @@
import org.zanata.model.security.HCredentials;

import javax.persistence.EntityManager;
import javax.persistence.Query;

/**
* @author Patrick Huang <a
Expand Down Expand Up @@ -82,6 +84,14 @@ public void deleteExceptEssentialData() {
enUSLocale =
forLocale(false, LocaleId.EN_US).makeAndPersist(entityManager,
HLocale.class);
entityManager.getTransaction().begin();
Query query = entityManager.createQuery(
"update HApplicationConfiguration set value = '' where key = :key");
query.setParameter("key", HApplicationConfiguration.KEY_HOME_CONTENT);
query.executeUpdate();
query.setParameter("key", HApplicationConfiguration.KEY_HELP_CONTENT);
query.executeUpdate();
entityManager.getTransaction().commit();
}

public void makeSampleLanguages() {
Expand Down

0 comments on commit 20297da

Please sign in to comment.