<commit_before># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>

from flask.ext.testing import TestCase as BaseTestCase
import os
from ggrc import db
from ggrc.app import app
from ggrc.models import create_db

if os.environ.get('TRAVIS', False):
  db.engine.execute("DROP DATABASE IF EXISTS ggrcdevtest;")
  db.engine.execute("CREATE DATABASE ggrcdevtest; USE ggrcdevtest;")

  create_db(use_migrations=True, quiet=True)


class TestCase(BaseTestCase):
  def setUp(self):
    for table in reversed(db.metadata.sorted_tables):
      if not table.name == "test_model":
        db.engine.execute(table.delete())
    db.session.commit()

    # if getattr(settings, 'MEMCACHE_MECHANISM', False) is True:<commit_msg>Fix failing tests<commit_after># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>

from flask.ext.testing import TestCase as BaseTestCase
import os
from ggrc import db
from ggrc.app import app
from ggrc.models import create_db

if os.environ.get('TRAVIS', False):
  db.engine.execute("DROP DATABASE IF EXISTS ggrcdevtest;")
  db.engine.execute("CREATE DATABASE ggrcdevtest; USE ggrcdevtest;")

  create_db(use_migrations=True, quiet=True)


class TestCase(BaseTestCase):
  def setUp(self):
    for table in reversed(db.metadata.sorted_tables):
      if table.name not in ("test_model", "roles", "notification_types", "object_types"):
        db.engine.execute(table.delete())
    db.session.commit()

    # if getattr(settings, 'MEMCACHE_MECHANISM', False) is True:
{'fraction_non_alphanumeric': 0.11596638655462185, 'fraction_numerical': 0.0067226890756302525, 'mean_word_length': 4.836601307189542, 'pattern_counts': {'":': 1, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5972046', 'n_tokens_mistral': 613, 'n_tokens_neox': 591, 'n_words': 163}