Commit graph

39 commits

Author SHA1 Message Date
Andrew Chen Wang
165cdb6a00
Add Django 3.2 Support and drop error dependency check (#181)
* Remove system check for Django version
* Closes #175
* Bump version and amend CHANGELOG
* Update with GitHub action CI
* Update README with Python and Django versions
* Limit Django version to 3.2, inclusively.
* Add note on Django constraints to README
* Bump minor version
* Justified by dropping support for dependency versions
* Drop support for Django 2.0-2.1, Python 3.5
* Change CI badge in README to GitHub actions
* Add support for Pymemcache for Django 3.2+
* Add Django 3.2 to test matrix
* Fix MySQL test_explain
* Allow filebased delta leniency in tests
* Allow Subquery in finding more Subqueries (Fixes #156)
* Reverts #157 with proper fix. The initial problem was due to `django.db.models.expressions.Subquery` allowing both QuerySet and sql.Query to be used.
* Fixes Django 3.2 test_subquery and test_invalidate_subquery testing by also checking the lhs
* Fix Django 2.2 Subquery having no query attr
* Fix filebased test time delta
* Fix test_invalidate_having due to new inner_query
* The new inner_query replaces subquery for Django 3.2 where subquery is now a boolean. That's why I initially used that TypeError in _get_tables_from_sql. inner_query looks to be a sql.Query
* Add PyMemcacheCache to supported cache backends

Co-authored-by: Dominik George <nik@naturalnet.de>
2021-05-13 00:27:14 -04:00
Andrew-Chen-Wang
6e22dc7f58 Drop Python 2.7 and Dj 1.11 2020-06-18 09:28:00 -04:00
Andrew-Chen-Wang
602cdcee1d
Version 2.2.0 (#146)
This PR upgrades cachalot to version 2.2.0 allowing for anyone to install cachalot at any Django package above 1.11. All tests currently function now.

* Added mysql as a service to fix Travis CI

* Removed tox dependency

* Removed upper limit on Django and support 2.2-3.0 CI Test
* Cachalot will only say "officially supports" while removing upper limit to not hinder anyone's progress.
* Added Python 3.8 and Django 2.2 and 3.0 to CI tests

- Max is 200 and we'll get there quickly if we add another Python version. Utilizes #127
- Keep dependencies for six and django.utils.six

* Correctly run Travis test by updating tox.ini
* Originally using tox syntax but changed testenv to travis so that travis env and travis dependencies and stuff are used

* Tox tests should start running command

* testenv without dependencies broke travis. New spot in Tox
* testenv without dependencies broke travis
* I can't figure out where testenv is supposed to be
* Good thing there's squash

* Added missing six in test
* Also added six package to Tox for Django 3.0 coverage.
* The missing six package caused several problems in several tests due to using an incorrect DB

* Resolves #138
* Need to add the panels here in order to satisfy tests

* Adds CachalotPanel to Python 2 backwards compatibility
* Forgot super class took those like save()

* Added databases to certain test cases
* APITestCase, DebugToolbarTestCase, SignalsTestCase required a database set
* Fixes errors like these: https://travis-ci.org/noripyt/django-cachalot/jobs/648691385#L4892

* Dropped OFFICIAL support for Python 3.4 + MySQL
* MySQL and its client on 3.4 is f--king up a lot of the testing and I can't bear with it. We can revisit it later, but, honestly, who uses Python 3.4... and if an organization is, then they will either have no problem with Postgres and SQLite or know that MySQL doesn't work.

* Drop Py3.4 from running. Fixed databases
* Now goes with setting's databases rather than hardcoded since some tests don't have other databases.

* Fix ReadTestCase

Django 2.2+ changed self.queryset at line 1000 with self.query=queryset.query

* Django Dependency Removed from utils.py

* Last commit used Django version. This one used try except

* Fixed assertNumQuery; added allow_failures for 3.4
* Primary: More information in test_utils.py with method is_django_21_below_and_is_sqlite
* The problem with the entire build lie in the self.is_sqlite for the tests. SQLite will make 2 queries when creating or destroying or updating instead of 1.
* In summary, if SQLite is the DB and Django

* Changed build matrix to allow failures for 3.4 instead of taking it out completely so that we can get it to work soon.

* Remove -> From function return
* I love backwards compatibility

* SQLite2 in multi_db.py returned incorrect bool

* Django 2.1 and SQLite checker doesn't work for some tests
* Some tests DO HAVE the BEGIN query that is returned... Not sure why. If the next test show completely different WriteTestCase problems, then we need to find alternative.
* Removed check from atomic

* Adjust Django and is_sqlite errors
* CI testing the Tox errors: https://travis-ci.org/noripyt/django-cachalot?utm_medium=notification&utm_source=github_status

* Adjust Django and is_sqlite errors (590 CI)
* CI testing the Tox errors: https://travis-ci.org/noripyt/django-cachalot?utm_medium=notification&utm_source=github_status
* Adjustment 2

* Make include matrix and Adjust Django and is_sqlite errors (594 CI)
* CI testing the Tox errors: https://travis-ci.org/noripyt/django-cachalot?utm_medium=notification&utm_source=github_status
* Adjustment 3

* Adjust Django and is_sqlite errors (596 CI)
* CI testing the Tox errors: https://travis-ci.org/noripyt/django-cachalot?utm_medium=notification&utm_source=github_status
* Adjustment 4
* Added my intro to ReadTheDocs

* Adjust Django and is_sqlite errors (598 CI)
* CI testing the Tox errors: https://travis-ci.org/noripyt/django-cachalot?utm_medium=notification&utm_source=github_status
* Adjustment 5

* Drop Python 3.4 from tests since PyLibMC not cooperating at that level.

* Bump package version up 1 minor for Django 2.2 and 3.0
2020-02-12 00:52:12 -05:00
Bertrand Bordage
74e000b8e2 Adds Django 2.0 support. 2018-05-04 20:26:26 +02:00
Kosei Kitahara
df42746729
Remove EOL version specific macros 2018-04-17 14:51:41 +09:00
Bertrand Bordage
809ef63fd9 Tests schema changing queries. 2017-06-03 22:01:42 +02:00
Bertrand Bordage
2d5ad63fbd Adds the Python type long to the cachable param types. 2017-06-03 18:25:07 +02:00
Bertrand Bordage
542a5b6097 Simplifies tests while increasing their robustness by explicitely checking detected table names. 2017-06-03 17:45:26 +02:00
Bertrand Bordage
27a7b318fc Tests invalidation of a nested raw subquery. 2017-06-03 15:26:53 +02:00
Bertrand Bordage
3b5dde8d30 Adds tests for RawSQL. 2017-06-03 15:18:20 +02:00
Bertrand Bordage
1f04294eb5 Updates tests for Django 1.11. 2017-06-03 01:53:56 +02:00
Bertrand Bordage
762456415a Fixes the test suite. 2016-09-06 20:01:48 +02:00
Bertrand Bordage
7177361267 Avoids extra invalidations during write operations. 2015-10-28 11:37:58 +01:00
Bertrand Bordage
7efb8ae232 Adds tests for many-to-many managers. 2015-10-02 23:19:02 +02:00
Bertrand Bordage
1c1b6ebd26 Add 2 test for foreign key relations. 2015-10-02 21:04:33 +02:00
Bertrand Bordage
9938b54123 Merge branch 'master' into django-1.8
Conflicts:
	cachalot/cache.py
	cachalot/monkey_patch.py
	cachalot/tests/read.py
	cachalot/utils.py
	tox.ini
2015-10-02 18:39:04 +02:00
Bertrand Bordage
d2b03e5d8d Creates a MySQL cursor before each test to avoid the extra SET SQL_AUTO_IS_NULL = 0 request. 2015-06-17 23:00:52 +02:00
Bertrand Bordage
00de631330 Rewrites #16 in a minimal way, using an existing test and the models. 2015-04-17 18:10:33 +02:00
Helen Warren
4eeeb70225 Tests related to many to many relationships used via exclude queries 2015-04-17 13:50:51 +01:00
Bertrand Bordage
c2d62dbad3 Uses database cursors as context managers. 2015-04-11 02:04:53 +02:00
Bertrand Bordage
16e14c9219 Drops Django 1.6 & Python 2.6 support. 2015-04-11 01:57:13 +02:00
Bertrand Bordage
76b2c08dc8 Adds more rare advanced queries not handled by cachalot. 2015-02-17 23:57:58 +01:00
Bertrand Bordage
cd278aea75 Moves a test method. 2015-02-17 22:07:23 +01:00
Bertrand Bordage
67c05ed460 Adds 2 tests for HAVING queries. 2015-02-17 21:47:41 +01:00
Bertrand Bordage
81b63eaff3 Adds a missing test for subqueries. 2015-02-17 21:23:51 +01:00
Bertrand Bordage
ae9dc1118b Fixes tests for SQLite. 2014-12-14 09:01:17 +01:00
Bertrand Bordage
1356de58af Adds the last missing tests. 2014-12-14 08:52:21 +01:00
Bertrand Bordage
3293c2c644 Adds tests for cursor.executemany. 2014-12-07 02:38:10 +01:00
Bertrand Bordage
6200a12b20 Invalidates raw queries. 2014-11-04 01:17:35 +01:00
Bertrand Bordage
a8fa93ebd3 Removes the hack for the number of queries with MySQL. 2014-10-29 20:00:33 +01:00
Bertrand Bordage
ddfbfba75d Caches all queries resulting of a `Queryset.extra`. 2014-10-29 19:38:33 +01:00
Bertrand Bordage
683b5463f1 Fixes yet another testing issue with SQLite. 2014-10-29 15:03:56 +01:00
Bertrand Bordage
38065f9454 Fixes the number of queries for SQLite. 2014-10-29 14:57:01 +01:00
Bertrand Bordage
7bfd570554 Adds tests for multi-table inheritance. 2014-10-29 13:46:27 +01:00
Bertrand Bordage
5a4f0a4f7a Fixes tests for Django 1.7 & MySQL. 2014-10-21 23:49:26 +02:00
Bertrand Bordage
e276d3961c Adds a test to find if the cache is invalidated after flush and loaddata commands. 2014-10-21 23:10:58 +02:00
Bertrand Bordage
a4f766fd14 Adds tests for select_for_update. 2014-10-20 17:25:20 +02:00
Bertrand Bordage
7877a13e82 Adds 2 tests. 2014-10-20 16:44:22 +02:00
Bertrand Bordage
0da4880442 Separates tests in several files. 2014-10-20 15:40:37 +02:00