Fix some test errors in extension manager caused by database changes.

Review Request #11976 — Created Jan. 22, 2022 and submitted

Information

Djblets
release-3.x

Reviewers

The extension manager tests were encountering a few errors caused by
changes to Django's database layer.

First, there were some errors coming from django-evolution using the
schema editor. The sqlite backend has been changed to error out if the
schema editor is invoked in the middle of an existing atomic
transaction, and django testcases are all run from within transactions.
To get around this, I've made it so the entire extension manager test
case disabled constraint checking.

Second, the allow_thread_sharing property was made read-only, and
changing it now requires using the inc_thread_sharing() and
dec_thread_sharing() methods. These have been added where appropriate.

Ran unit tests.

Summary ID
Fix some test errors in extension manager caused by database changes.
The extension manager tests were encountering a few errors caused by changes to Django's database layer. First, there were some errors coming from django-evolution using the schema editor. The sqlite backend has been changed to error out if the schema editor is invoked in the middle of an existing atomic transaction, and django testcases are all run from within transactions. To get around this, I've made it so the entire extension manager test case disabled constraint checking. Second, the `allow_thread_sharing` property was made read-only, and changing it now requires using the `inc_thread_sharing()` and `dec_thread_sharing()` methods. These have been added where appropriate. Testing Done: Ran unit tests.
90f5cf9abbbc2dd1c2322dd302bf8a322cd251a8
Description From Last Updated

I feel we want to wrap this all in a try/finally.

chipx86chipx86
chipx86
  1. 
      
  2. djblets/extensions/tests/test_extension_manager.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    I feel we want to wrap this all in a try/finally.

  3. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.x (ed25d87)
Loading...