def post(self, request):
        model = self.model
        if not model.form or not self.get_user:
            raise MethodNotAllowed
        data, _ = request.data_and_files()
        form = model.form(request, data=data)
        if form.is_valid():
            expiry = form.cleaned_data.get('expiry')
            if not expiry:
                days = request.config['ACCOUNT_ACTIVATION_DAYS']
                expiry = datetime.now() + timedelta(days=days)
            user = self.get_user(request)
            # TODO, this is for multirouters
            if isinstance(user, tuple):
                user = user[0]
            backend = request.cache.auth_backend
            auth_key = backend.create_auth_key(request, user, expiry=expiry)
            data = {'registration_key': auth_key}
            request.response.status_code = 201
        else:
            data = form.tojson()
        return Json(data).http_response(request)
Runs nose test suite
dataset/ETHPy150Open quantmind/lux/lux/extensions/auth/views.py/RegistrationCRUD.post--crossover with--dataset/ETHPy150Open agconti/cookiecutter-django-rest/{{cookiecutter.github_repository_name}}/fabfile.py/test