Exemplo n.º 1
0
    def submit_simple_form(self, data):
        from tests.forms import SimpleReportedForm

        form = SimpleReportedForm(data=data)
        form.ga_client_id = form.get_ga_client_id(
        )  # freeze a generated client id
        return form
    def test_no_errors_send_no_reports(self):
        from tests.forms import SimpleReportedForm

        form = SimpleReportedForm(data={
            'required_number': 4,
            'required_text': 'abc',
        })
        with mock.patch.object(SimpleReportedForm, 'report_errors_to_ga', return_value=None) as method:
            self.assertTrue(form.is_valid())
            self.assertFalse(method.called)
Exemplo n.º 3
0
    def test_no_errors_send_no_reports(self):
        from tests.forms import SimpleReportedForm

        form = SimpleReportedForm(data={
            'required_number': 4,
            'required_text': 'abc',
        })
        with mock.patch.object(SimpleReportedForm, 'report_errors_to_ga', return_value=None) as method:
            self.assertTrue(form.is_valid())
            self.assertFalse(method.called)
    def submit_simple_form(self, data):
        from tests.forms import SimpleReportedForm

        form = SimpleReportedForm(data=data)
        form.ga_client_id = form.get_ga_client_id()  # freeze a generated client id
        return form