<commit_before>from mysite.base.tests import make_twill_url, TwillTests
from mysite import senseknocker

class Form(TwillTests):
    fixtures = ['person-paulproteus.json', 'user-paulproteus.json']

    def test_form_post_handler(self):
        client = self.login_with_client()
        bug_data = {'before': 'I was singing "<NAME>" to a potful of dal.', 
                    'expected_behavior': 'I expected the dal to be stirred.', 
                    'actual_behavior': 'Instead, burnination.'}
        json = client.post('/senseknocker/handle_form', bug_data)

        # Check there exists at least one bug with the given characteristics
        # in the DB. (There can be more than one, hypothechnically.)
        bugs = list(senseknocker.models.Bug.objects.filter(
            before=bug_data['before'], 
            expected_behavior=bug_data['expected_behavior'],
            actual_behavior=bug_data['actual_behavior']
            ))
        self.assert_(bugs)
        self.assertEqual(json.content, '[{"success": 1}]')<commit_msg>Corrected small error in name of field in senseknocker.forms.Form.<commit_after>from mysite.base.tests import make_twill_url, TwillTests
from mysite import senseknocker

class Form(TwillTests):
    fixtures = ['person-paulproteus.json', 'user-paulproteus.json']

    def test_form_post_handler(self):
        client = self.login_with_client()
        bug_data = {'background': 'I was singing "<NAME>" to a potful of dal.', 
                    'expected_behavior': 'I expected the dal to be stirred.', 
                    'actual_behavior': 'Instead, burnination.'}
        json = client.post('/senseknocker/handle_form', bug_data)

        # Check there exists at least one bug with the given characteristics
        # in the DB. (There can be more than one, hypothechnically.)
        bugs = list(senseknocker.models.Bug.objects.filter(
            background=bug_data['background'], 
            expected_behavior=bug_data['expected_behavior'],
            actual_behavior=bug_data['actual_behavior']
            ))
        import pdb
        pdb.set_trace()
        self.assert_(bugs)
        self.assertEqual(json.content, '[{"success": 1}]')
{'fraction_non_alphanumeric': 0.10786106032906764, 'fraction_numerical': 0.0009140767824497258, 'mean_word_length': 2.8538732394366195, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '7363655', 'n_tokens_mistral': 639, 'n_tokens_neox': 597, 'n_words': 156}