Code

Ticket #20098: 20098-Support.patch

File 20098-Support.patch, 3.4 KB (added by carsten.klein@…, 16 months ago)

Adds test case for unmanaged model classes

  • new file tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app1/models.py

    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/__init__.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/__init__.py
    new file mode 100644
    index 0000000..e69de29
    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app1/__init__.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app1/__init__.py
    new file mode 100644
    index 0000000..e69de29
    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app1/models.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app1/models.py
    new file mode 100644
    index 0000000..0f4a07a
    - +  
     1 
     2 
     3from django.db import models 
     4 
     5 
     6 
     7class First(models.Model): 
     8 
     9    class Meta: 
     10 
     11        app_label = 'app' 
     12 
     13        db_table = 'duplicate' 
     14 
  • new file tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app2/models.py

    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app2/__init__.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app2/__init__.py
    new file mode 100644
    index 0000000..e69de29
    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app2/models.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_multiple_app/app2/models.py
    new file mode 100644
    index 0000000..0f4a07a
    - +  
     1 
     2 
     3from django.db import models 
     4 
     5 
     6 
     7class First(models.Model): 
     8 
     9    class Meta: 
     10 
     11        app_label = 'app' 
     12 
     13        db_table = 'duplicate' 
     14 
  • new file tests/regressiontests/admin_scripts/duplicate_db_table_declaration_single_app/models.py

    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_single_app/__init__.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_single_app/__init__.py
    new file mode 100644
    index 0000000..e69de29
    diff --git a/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_single_app/models.py b/tests/regressiontests/admin_scripts/duplicate_db_table_declaration_single_app/models.py
    new file mode 100644
    index 0000000..0be2241
    - +  
     1 
     2 
     3from django.db import models 
     4 
     5 
     6 
     7class First(models.Model): 
     8 
     9    class Meta: 
     10 
     11        db_table = 'duplicate' 
     12 
     13 
     14class Second(models.Model): 
     15 
     16    class Meta: 
     17 
     18        db_table = 'duplicate' 
     19 
  • new file tests/regressiontests/admin_scripts/unmanaged_duplicate_db_table_declaration/models.py

    diff --git a/tests/regressiontests/admin_scripts/unmanaged_duplicate_db_table_declaration/__init__.py b/tests/regressiontests/admin_scripts/unmanaged_duplicate_db_table_declaration/__init__.py
    new file mode 100644
    index 0000000..e69de29
    diff --git a/tests/regressiontests/admin_scripts/unmanaged_duplicate_db_table_declaration/models.py b/tests/regressiontests/admin_scripts/unmanaged_duplicate_db_table_declaration/models.py
    new file mode 100644
    index 0000000..ef31a67
    - +  
     1 
     2 
     3from django.db import models 
     4 
     5 
     6 
     7class Managed(models.Model): 
     8 
     9    class Meta: 
     10 
     11        db_table = 'duplicate' 
     12 
     13 
     14class Unmanaged(models.Model): 
     15 
     16    class Meta: 
     17 
     18        db_table = 'duplicate' 
     19 
     20        managed = False 
     21