Last active
January 28, 2018 12:06
-
-
Save fusion44/f96c894f565da5161d2e9e9e7ad83a75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Django 2.0.1 | |
# This probably has something todo tith this: https://docs.python.org/dev/library/unittest.mock.html#where-to-patch | |
# I can't figure out the right way to patch the usage of this function. | |
# this prints True: | |
print(hasattr(backend.transactions.fetchers.generic_exchange, | |
"update_exchange_tx_generic")) | |
# but my lambda is never called and throws no error | |
monkeypatch.setattr(backend.transactions.fetchers.generic_exchange, | |
"update_exchange_tx_generic", | |
lambda account: print("lambda")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is the user script of the function | |
import graphene | |
from backend.transactions.fetchers.generic_exchange import update_exchange_tx_generic | |
class AccountRefreshTransactionsMutation(graphene.relay.ClientIDMutation): | |
@classmethod | |
def mutate(cls, root, info, input) -> "AccountRefreshTransactionsMutation": | |
# ... | |
update_exchange_tx_generic(account) | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment