Commit Graph

28 Commits (a950049356f7dd80c4062e5810a4c6d1b462b4be)

Author SHA1 Message Date
Diederik van der Boor a950049356 Improved and added more admin test cases 2017-09-30 18:16:59 +02:00
Diederik van der Boor 8d4cb9b151 Added rudimentary admin test cases 2017-09-30 17:47:02 +02:00
Diederik van der Boor 04d4181e17 Added `get_base_polymorphic_model()` to detect the common base class for a polymorphic model. 2017-09-30 16:21:21 +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 a507345c6d Move test models into models.py and add migrations
Tests were failing on postgres due to foreign keys pointing to missing
tables.
In order for these tables to be present, we need migrations which
declare depending on `content_type`.
2017-09-06 19:47:18 -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
Jerome Leclanche 3af5db0ceb tests: Clean up and simplify test_reset_polymorphic_ctype 2017-08-29 19:41:42 +03:00
Jerome Leclanche 0c7b1aa657 Drop support for Django 1.8 2017-08-29 19:41:42 +03:00
Diederik van der Boor 77797bfa12 Ensure consistent ordering in testing reset_polymorphic_ctype
Amends: 171d14f369
2017-08-01 13:51:42 +02:00
Diederik van der Boor 171d14f369 Improve reset_polymorphic_ctype() for reliability and test it.
This function can now be safely used on a set of models.
2017-08-01 12:17:10 +02:00
Diederik van der Boor e10deeaebd Remove test imports that Django 1.5- required 2017-08-01 12:17:10 +02: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
Tadas Dailyda 0fea8a4d92 tests for abstract/swappable model initialization 2017-07-25 14:02:15 +03:00
Jerome Leclanche 1e7237986c Specify on_delete argument for all related fields that need it 2017-07-10 09:08:11 +03: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
Diederik van der Boor a3c9bcb14a Merge remote branch 'meshy/new-test-versions' 2017-04-06 13:57:07 +02:00
Diederik van der Boor d8cb700e58 Make sure tests can run in Django 1.11 2017-04-06 12:51:16 +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
Charlie Denton 8e52bdf6d1
Explicitly name ids of clashing base models
This avoids the following error in django 1.11 tests:

    polymorphic.MRODerived: (models.E005) The field 'id' from parent model 'polymorphic.mrobase3' clashes with the field 'id' from parent model 'polymorphic.mrobase1'.

Related to https://code.djangoproject.com/ticket/22442
2017-03-03 22:16:54 +00:00
Diederik van der Boor 7dc2f93148 Added plain tests for admin importing 2017-02-03 22:05:13 +01:00
Diederik van der Boor 66619371fd remove empty test_models.py file 2017-02-03 22:05:13 +01: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