'Test that ``RegistrationFormTermsOfService`` requires
agreement to the terms of service.'

def test_registration_form_tos(self):

    form = forms.RegistrationFormTermsOfService(data={u'username': u'foo', u'email': u'foo@example.com', u'password1': u'foo', u'password2': u'foo'})
    self.failIf(form.is_valid())
    self.assertEqual(form.errors[u'tos'], [u'You    must    agree    to    the    terms    to    register'])
    form = forms.RegistrationFormTermsOfService(data={u'username': u'foo', u'email': u'foo@example.com', u'password1': u'foo', u'password2': u'foo', u'tos': u'on'})
    self.failUnless(form.is_valid())
