Diederik van der Boor
59c020ee50
Reformat all files with isort and black
2019-07-15 09:50:15 +02:00
Diederik van der Boor
49f89ffb21
Fix random unit test failing due to model ordering
2019-07-12 17:53:16 +02:00
Diederik van der Boor
8fb8f47fb0
Fix compatibility with Django 3.0 alpha
...
Removed django.utils.six dependency, copied the parts we still need for
Python 2 compatibility.
2019-07-12 17:39:59 +02:00
Diederik van der Boor
f769ed7568
Fix dealing with missing derived table data with new prefetching code
2019-07-12 10:01:40 +02:00
Diederik van der Boor
3d9587acfb
Merge PR #353
2019-07-12 09:45:21 +02:00
Diederik van der Boor
4f89a879c0
Add tests for missing content types
2019-07-12 09:43:11 +02:00
Diederik van der Boor
ec3fb34f08
Merge pull request #365 from ghost/fix/37-subclass-selector-on-abstract-proxy-models
...
#37 : Fix model subclass ___ selector for abstract/proxy models
2019-07-11 22:12:24 +02:00
Diederik van der Boor
a1c779a295
Merge pull request #369 from marksweb/fix/202
...
Raise `PolymorphicTypeInvalid` instead of cause `TypeError`
2019-07-11 22:09:14 +02:00
gtors
f06a02a3d0
Issue #373 : Fix bug with get_real_instances on empty base_result_objects
2019-07-11 21:59:46 +02:00
Diederik van der Boor
26fac56e31
Squash Merge PR #379 for Django 2.2 support
...
Author: Asif Saif Uddin <auvipy@gmail.com>
Author: jeff <jeff@mighty.com>
2019-07-11 21:57:46 +02:00
Mark Walker
3d9ac45cec
Correct the docstring for the invalid test.
2018-11-22 20:12:48 +00:00
Mark Walker
fd9d0fa2b8
Raise exception instead of cause `TypeError` when `polymorphic_ctype_id` is invalid.
2018-11-22 20:05:57 +00:00
Lukasz Zdun
14b31bed4c
#37 : Fix model subclass ___ selector for abstract/proxy models
2018-09-29 09:16:16 +02:00
Diederik van der Boor
9042fdd689
Replace instance_of OR query with IN statement
2018-08-24 11:16:30 +02:00
Diederik van der Boor
5f50aa1dca
fix test warnings about \d+ escape
2018-08-23 14:24:32 +02:00
Markus Grimm
0f6352d74d
Added test
2018-08-09 09:13:48 +02:00
Charlie Denton
ed40b9e3e2
Use assertRegex to ignore object IDs
...
Sometimes the tests failed because these objects had IDs that differed
from expectations. As the IDs are not relevant to this test, I have
replaced the exact string match with a regex match that accepts any ID.
2018-01-17 22:02:19 +00:00
Charlie Denton
3f6d94139c
Remove unused function in tests
2018-01-16 10:54:33 +00:00
Krzysztof Gromadzki
8dc9bd2543
Review applied
2017-12-31 17:14:23 +01:00
Krzysztof Gromadzki
010a23425f
Add support for bulk_create
2017-12-29 19:05:57 +01:00
Diederik van der Boor
8f0932b71e
Fixed applabel__ModelName___field looksups
...
Closes : #286
2017-11-20 15:19:21 +01:00
Diederik van der Boor
2e16112cbe
Merge branch 'fix-defer-childs-same-polymorphic-parent' into master
2017-09-30 20:26:37 +02:00
Hugo Osvaldo Barrera
e102a0502c
Update a bunch of failing tests
...
Tests were failing because of:
* Models weren't being imported from their new location.
* PolymorphicManager doesn't work with non-polymorphic models, but
migrations run models' manager, so having MROBase3 with
PolymorphicManager failed.
* Some tests failed due to have assertions were being done (since they
hardcoded expected instance ids). Update tests to use comparisons
similar to #312
2017-09-06 20:06:25 -03:00
Hugo Osvaldo Barrera
80b4f2bb41
Fix failing tests with django/master
...
Several tests were failing with django master. This is because,
apparently, IDs don't match those expected in tests, and other
test-related details.
Replace all test comparisons with assertQuerysetEqual, which is safer
and cleaner for the sort of comparison we're doing.
2017-09-06 22:41:13 +03:00
trbs
9500a21f82
fix error with .defer and child models that use the same parent
...
When using .defer on a PolymorphicQuerySet with multiple childs that
subclass from the same polymorphic parent model yield an error like:
>>> Base.objects.defer('ModelY___field_y')
Traceback (most recent call last):
...
FieldDoesNotExist: ModelX has no field named 'field_y'
2017-08-30 21:17:05 +02:00
Jerome Leclanche
0c7b1aa657
Drop support for Django 1.8
2017-08-29 19:41:42 +03:00
Diederik van der Boor
fb8eed78ad
Provide a better error message when polymorphic_ctype_id is Null
...
refs #51 , #140 , #304
2017-08-01 11:44:21 +02:00
Diederik van der Boor
b772c06358
move contrib tests to separate file
2017-08-01 11:44:21 +02:00
Jerome Leclanche
298460c4cf
Drop support for Django <1.8, Python <2.7
2017-07-10 09:08:11 +03:00
Diederik van der Boor
44d79b5a19
Fixed Python 2.6 support in test code
2017-05-01 12:45:43 +02:00
Diederik van der Boor
9c618d8b21
Improve tests to use a unified qrepr() output
2017-05-01 12:34:49 +02:00
Charlie Denton
aefb7dabc2
Django 1.11 uses real class names in __repr__()
...
See https://code.djangoproject.com/ticket/27546 and
https://github.com/django/django/commit/48826aa
2017-03-03 22:56:09 +00:00
Diederik van der Boor
add90aac4f
Replace assertEquals -> assertEqual
2017-01-09 15:14:55 +01:00
Diederik van der Boor
1f15a72a80
Moved polymorphic models back to tests/__init__.py, for Django 1.6-
2017-01-09 15:12:26 +01:00
Diederik van der Boor
b9f1709587
Update model paths in tests to new split test paths
2017-01-09 14:42:34 +01:00
Diederik van der Boor
9493bd8bc1
split tests.py into a python package
2017-01-09 14:41:56 +01:00