<commit_before>import time

from django.test import LiveServerTestCase
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.support import ui
from selenium.common.exceptions import NoSuchElementException


class WidgetTestCase(LiveServerTestCase):
    fixtures = ['test.json']

    @classmethod
    def setUpClass(cls):
        cls.selenium = WebDriver()
        super(WidgetTestCase, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(WidgetTestCase, cls).tearDownClass()
        cls.selenium.quit()

    def autocomplete_visible(self):
        try:
            return self.autocomplete_element().is_displayed()
        except NoSuchElementException:
            return False

    def autocomplete_element(self):
        return self.selenium.find_element_by_css_selector(<commit_msg>Ensure test/test user exists in WidgetTestCase<commit_after>import time

from django.test import LiveServerTestCase
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.support import ui
from selenium.common.exceptions import NoSuchElementException


class WidgetTestCase(LiveServerTestCase):
    fixtures = ['test.json', 'initial_data.json']

    @classmethod
    def setUpClass(cls):
        cls.selenium = WebDriver()
        super(WidgetTestCase, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(WidgetTestCase, cls).tearDownClass()
        cls.selenium.quit()

    def autocomplete_visible(self):
        try:
            return self.autocomplete_element().is_displayed()
        except NoSuchElementException:
            return False

    def autocomplete_element(self):
        return self.selenium.find_element_by_css_selector(
{'fraction_non_alphanumeric': 0.0769650655021834, 'fraction_numerical': 0.0, 'mean_word_length': 3.7364341085271318, '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': '2628099', 'n_tokens_mistral': 525, 'n_tokens_neox': 489, 'n_words': 109}