Store model history and view/revert changes from admin site.
Merged. Let's hope it passes! 🤞
Remove python 3.6
Use github for flake8
Merge pull request #39 from spapas/remove-python3.6
Remove python 3.6
I agree. 👍 Let's drop support for anything that's been EOL'd for over a year.
To re-initialize I'm posting a run
message to the web worker, which calls callMain(event.data.args)
again.
Use CPython compiled for WebAssembly and then import unittest.mock
Or visit this page and click the "Run in Browser" button to see the error.
The error shown is:
Traceback (most recent call last):
File "//__main__.py", line 2, in <module>
import unittest.mock
File "/home/runner/work/cpython-wasm-test/cpython-wasm-test/cpython/Lib/unittest/mock.py", line 26, in <module>
File "/home/runner/work/cpython-wasm-test/cpython-wasm-test/cpython/Lib/asyncio/__init__.py", line 8, in <module>
File "/home/runner/work/cpython-wasm-test/cpython-wasm-test/cpython/Lib/asyncio/base_events.py", line 18, in <module>
ModuleNotFoundError: No module named 'concurrent'
This error seems to only occur on the WebAssembly build for the browser (the Node build allows unittest.mock
to be imported as expected).
Closing, as unittest.mock
works for me now
When importing unittest.mock
, an exception is raised due to unittest.mock
importing asyncio
.
It seems the asyncio
library is only used in unittest.mock
when mocking async functions.
I believe delaying the import of asyncio
until the moment it's needed would make unittest.mock
functional for most use cases on WASM builds.
A demonstration of the error: https://www.pythonmorsels.com/r/35fv2/
CPython 3.11.0rc1 built with Emscripten for the web browser
Duplicate of #96883. I accidentally opened this issue twice.
The following code runs correctly the first time but then complains that datetime.strptime
is of type NoneType
the second time the code is run within the same browser session.
"""Demonstrates WASM issue with datetime.strptime."""
from datetime import datetime
print(datetime.strptime("2023-01-13", "%Y-%m-%d"))
print(datetime.strptime("2023-01-13", "%Y-%m-%d"))
Live example here: https://pym.dev/p/2g6wn/
Note that running datetime.strptime
twice doesn't cause an issue. The issue seems to be due to exiting Python and then re-entering it. For example in an interactive session, one would need to call exit()
and then start the interactive session again in the same browser window (example here).
>>> from datetime import datetime
>>> datetime.strptime("2023", "%Y")
datetime.datetime(2023, 1, 1, 0, 0)
>>> exit() # The REPL is automatically re-entered after this
>>> from datetime import datetime
>>> datetime.strptime("2023", "%Y")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable
CPython 3.11.0 compiled to Emscripten for the browser.
I'm using freezegun, so I'm affected by #126.
When I set CACHALOT_ENABLED= False
in my settings, my tests pass.
I'd prefer to use cachalot for most of my tests and only disable it for the tests where freezegun is used. When I use override_settings(CACHALOT_ENABLED=False)
, the setting does change but the queries with the test are still cached.
Using the override_settings
decorator to disable CACHALOT_ENABLED
should have disabled caching during the decorated test.
Use the @override_settings(CACHALOT_ENABLED=False)
decorator on a test that uses freezegun.freeze_time
for a long past date. When calling the refresh_from_db()
method on a model instance, the instance will not refresh even if it has been changed.
I'm using Docker with Postgres and on Django 3.2.7.
@xuhdev @ffes I added the CNAME record. It looks like there's an SSL error now though.
Site updated at 2022-12-02 18:38:00 UTC