When testing Django with CUBRID, the sqlflush command was failed because the Django test cases need to cleanup all data in the database before begining new tests.
Issue CUBRIDSUS-10436 mentioned this bug.
In order to continue the Django test with CUBRID, I adopted a workaround as below:
Sort the tables according to the foreign key constraints and then delete the data in the tables by order.
If there is the circular dependency, the above workaround will fail. So, this workaround isn't merged into the Django_cubrid backend.
Run the test cases by the command like below:
python manage.py test contenttypes
python manage.py test sessions
python manage.py test sites
python manage.py test auth
| Django App | Success | Failed | Failed cases |
|---|---|---|---|
| django.contrib.contenttypes | 8 | 0 | |
| django.contrib.sessions | 197 | 0 | |
| django.contrib.sites | 3 | 1 | test_save_another (django.contrib.sites.tests.SitesFrameworkTests) |
| django.contrib.auth | 133 | 5 | test_bug_5605 (django.contrib.auth.tests.forms.PasswordResetFormTest) test_cleaned_data (django.contrib.auth.tests.forms.PasswordResetFormTest) test_inactive_user (django.contrib.auth.tests.forms.PasswordResetFormTest) test_unusable_password (django.contrib.auth.tests.forms.PasswordResetFormTest) test_success (django.contrib.auth.tests.forms.UserCreationFormTest) |