<commit_before>from django.test import TestCase
from django.test import LiveServerTestCase
from wagtail.tests.utils import WagtailPageTests
from simple_salesforce import Salesforce as SimpleSalesforce
from .salesforce import Salesforce
from django.test import TestCase, override_settings
from django.core.management import call_command
from django.utils.six import StringIO
from salesforce.models import Adopter

from django.conf import settings

class SalesforceTest(LiveServerTestCase,WagtailPageTests):
    def setUp(self):
        super(WagtailPageTests, self).setUp()
        super(LiveServerTestCase, self).setUp()

    def test_login(self):
        sf = SimpleSalesforce(**settings.SALESFORCE)
        self.assertEqual(sf.sf_instance, u'na12.salesforce.com')

    def test_database_query(self):
        sf = SimpleSalesforce(**settings.SALESFORCE)
        contact_info = sf.query(
            "SELECT Id FROM Contact WHERE Accounts_ID__c = '0'")
        self.assertEqual(
            contact_info['records'][0]['Id'], u'003U000001erXyqIAE')

    def test_faculty_confirmed(self):
        with Salesforce() as sf:
            status = sf.faculty_status(0)
            self.assertEqual(status, u'Confirmed')

    def test_faculty_unknown(self):
        with Salesforce() as sf:<commit_msg>add import<commit_after>from django.test import TestCase
from django.test import LiveServerTestCase
from wagtail.tests.utils import WagtailPageTests
from simple_salesforce import Salesforce as SimpleSalesforce
from .salesforce import Salesforce
from django.test import TestCase, override_settings
from django.core.management import call_command
from django.utils.six import StringIO
from salesforce.models import Adopter
import unittest
from django.conf import settings

class SalesforceTest(LiveServerTestCase,WagtailPageTests):
    def setUp(self):
        super(WagtailPageTests, self).setUp()
        super(LiveServerTestCase, self).setUp()

    def test_login(self):
        sf = SimpleSalesforce(**settings.SALESFORCE)
        self.assertEqual(sf.sf_instance, u'na12.salesforce.com')

    def test_database_query(self):
        sf = SimpleSalesforce(**settings.SALESFORCE)
        contact_info = sf.query(
            "SELECT Id FROM Contact WHERE Accounts_ID__c = '0'")
        self.assertEqual(
            contact_info['records'][0]['Id'], u'003U000001erXyqIAE')

    def test_faculty_confirmed(self):
        with Salesforce() as sf:
            status = sf.faculty_status(0)
            self.assertEqual(status, u'Confirmed')

    def test_faculty_unknown(self):
        with Salesforce() as sf:
{'fraction_non_alphanumeric': 0.08384615384615385, 'fraction_numerical': 0.010769230769230769, 'mean_word_length': 3.9168241965973536, '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': '1313874', 'n_tokens_mistral': 775, 'n_tokens_neox': 734, 'n_words': 180}