Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

responses module has a name conflict with my django app #1773

Closed
ksarge opened this issue Aug 11, 2018 · 3 comments
Closed

responses module has a name conflict with my django app #1773

ksarge opened this issue Aug 11, 2018 · 3 comments

Comments

@ksarge
Copy link

ksarge commented Aug 11, 2018

I have an existing code base with a django app called responses. I believe this is making it impossible for the responses.py file to be loaded in by models.py . Is there a workaround for when a django project has a naming conflict with one of these modules?

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-62748603b6e5> in <module>()
----> 1 import moto

/usr/local/lib/python3.6/site-packages/moto/__init__.py in <module>()
      6 __version__ = '1.3.3'
      7 
----> 8 from .acm import mock_acm  # flake8: noqa
      9 from .apigateway import mock_apigateway, mock_apigateway_deprecated  # flake8: noqa
     10 from .autoscaling import mock_autoscaling, mock_autoscaling_deprecated  # flake8: noqa

/usr/local/lib/python3.6/site-packages/moto/acm/__init__.py in <module>()
      1 from __future__ import unicode_literals
----> 2 from .models import acm_backends
      3 from ..core.models import base_decorator
      4 
      5 acm_backend = acm_backends['us-east-1']

/usr/local/lib/python3.6/site-packages/moto/acm/models.py in <module>()
      4 import json
      5 import datetime
----> 6 from moto.core import BaseBackend, BaseModel
      7 from moto.ec2 import ec2_backends
      8 

/usr/local/lib/python3.6/site-packages/moto/core/__init__.py in <module>()
      1 from __future__ import unicode_literals
----> 2 from .models import BaseModel, BaseBackend, moto_api_backend  # flake8: noqa
      3 
      4 moto_api_backends = {"global": moto_api_backend}

/usr/local/lib/python3.6/site-packages/moto/core/models.py in <module>()
    121 
    122 
--> 123 RESPONSES_METHODS = [responses.GET, responses.DELETE, responses.HEAD,
    124                      responses.OPTIONS, responses.PATCH, responses.POST, responses.PUT]
    125 

AttributeError: module 'responses' has no attribute 'GET'
@spulec
Copy link
Collaborator

spulec commented Sep 22, 2018

This is a third-party app you are installing or an app that you created locally?

@ksarge
Copy link
Author

ksarge commented Sep 23, 2018

It’s an app we created locally.

@spulec
Copy link
Collaborator

spulec commented Oct 15, 2018

This should get solved with #1847 so going to close this in favor of that.

@spulec spulec closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants