<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import datetime
import json
import unittest

import mock
from django.db.models import Q
from django.test import TestCase
from elasticsearch.serializer import JSONSerializer

from wagtail.tests.search import models
from wagtail.wagtailsearch.backends.elasticsearch2 import (
    Elasticsearch2SearchBackend, get_model_root)
from wagtail.wagtailsearch.query import MATCH_ALL

from .elasticsearch_common_tests import ElasticsearchCommonSearchBackendTests


class TestElasticsearch2SearchBackend(ElasticsearchCommonSearchBackendTests, TestCase):
    backend_path = 'wagtail.wagtailsearch.backends.elasticsearch2'


class TestElasticsearch2SearchQuery(TestCase):
    def assertDictEqual(self, a, b):<commit_msg>Unused import.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import datetime
import json

import mock
from django.db.models import Q
from django.test import TestCase
from elasticsearch.serializer import JSONSerializer

from wagtail.tests.search import models
from wagtail.wagtailsearch.backends.elasticsearch2 import (
    Elasticsearch2SearchBackend, get_model_root)
from wagtail.wagtailsearch.query import MATCH_ALL

from .elasticsearch_common_tests import ElasticsearchCommonSearchBackendTests


class TestElasticsearch2SearchBackend(ElasticsearchCommonSearchBackendTests, TestCase):
    backend_path = 'wagtail.wagtailsearch.backends.elasticsearch2'


class TestElasticsearch2SearchQuery(TestCase):
    def assertDictEqual(self, a, b):
{'fraction_non_alphanumeric': 0.05845380263984915, 'fraction_numerical': 0.00754242614707731, 'mean_word_length': 7.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6269749', 'n_tokens_mistral': 437, 'n_tokens_neox': 454, 'n_words': 110}