@override_settings(REGISTRATION_MODE="admin_only")
    def test_auth_registration_admin_only_fails_if_not_admin(self):
        url = '/v1/auth/register'
        submit = {
            'username': 'testuser',
            'password': 'password',
            'first_name': 'test',
            'last_name': 'user',
            'email': 'test@user.com',
            'is_superuser': False,
            'is_staff': False,
        }
        response = self.client.post(url, json.dumps(submit), content_type='application/json')
        self.assertEqual(response.status_code, 403)
test that a non superuser cannot register when registration is admin only.
dataset/ETHPy150Open deis/deis/controller/api/tests/test_auth.py/AuthTest.test_auth_registration_admin_only_fails_if_not_admin