Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Test Django with CUBRID

Test environment

  • Python 2.7.3
  • Django 1.4.2
  • CUBRID-Python


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.

Test method

Run the test cases by the command like below:

    python test contenttypes
    python test sessions
    python test sites
    python test auth

Test Results

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)

Known Issues

  • The Django sqlflush command maybe failed because of the foreign constraints between database tables. The error message maybe like below:
    (-924, "ERROR: DBMS, -924, Update/Delete operations are restricted by the foreign key 'fk_auth_custompermissionsuser_user_permissions_permission_id'.")
  • After using the Django loaddata command, the insert SQL manipulation in the application maybe failed, becuse of the unique constraint violations. The error message maybe like below:
    DatabaseError: (-670, 'ERROR: DBMS, -670, Operation would have caused one or more unique constraint violations. INDEX pk_django_site_id(B+tree: 0|421|1200) ON CLASS django_site(CLASS_OID: 0|489|3). key: 1(OID: 0|1210|2).')
  • Perhaps you may encounter the below warning:
    RuntimeWarning: DateTimeField received a naive datetime (2013-01-15 06:38:37.463000) while time zone support is active.
    The reason is that CUBRID dosen't support timezone. You can set "USE_TZ" to False in to avoid this warning.
comments powered by Disqus
Page info
viewed 1664 times
translations en
posted 4 years ago by
updated 4 years ago by
View revisions
Share this article