'test that a registration should fail with a nonexistant mode'

@override_settings(REGISTRATION_MODE=u'not_a_mode')
def test_auth_registration_fails_with_nonexistant_mode(self):

    url = u'/v1/auth/register'
    submit = {u'username': u'testuser', u'password': u'password', u'first_name': u'test', u'last_name': u'user', u'email': u'test@user.com', u'is_superuser': False, u'is_staff': False}
    try:
        self.client.post(url, json.dumps(submit), content_type=u'application/json')
    except Exception as e:
        self.assertEqual(str(e), u'not_a_mode    is    not    a    valid    registation    mode')
