| 1 | from django.db.models import CharField, ManyToManyField, Model | 
|---|
| 2 |  | 
|---|
| 3 |  | 
|---|
| 4 | class Filler(Model): | 
|---|
| 5 | name = CharField(max_length=40) | 
|---|
| 6 | class Meta: | 
|---|
| 7 | abstract=True | 
|---|
| 8 |  | 
|---|
| 9 | class Ring(Filler): | 
|---|
| 10 | "...to bring them all and in the darkness bind them" | 
|---|
| 11 | pass | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 | class Onesie(Filler): | 
|---|
| 15 | "this will test for #22975 bug - model name changed, db_table keeps it the same" | 
|---|
| 16 | class Meta: | 
|---|
| 17 | db_table = "x_one" | 
|---|
| 18 |  | 
|---|
| 19 |  | 
|---|
| 20 | class Twosies(Filler): | 
|---|
| 21 | "does not ignore db_table in init, color me surprised.  okay, test reverse of #22975" | 
|---|
| 22 | pass | 
|---|
| 23 |  | 
|---|
| 24 |  | 
|---|
| 25 | class Three(Filler): | 
|---|
| 26 | "this will be the new bug - M2M field name changed, db_table keeping old table name ignored" | 
|---|
| 27 | ringsies = ManyToManyField("Ring", db_table="x_three_ring") | 
|---|
| 28 |  | 
|---|
| 29 |  | 
|---|
| 30 | class Four(Filler): | 
|---|
| 31 | "this will test implicitly suspected bug, original db_table ignored, too" | 
|---|
| 32 | "phase two, verify that reverse is equally broken (must be, huh?)" | 
|---|
| 33 | ring = ManyToManyField("Ring", db_table="x_four_ringsie") | 
|---|
| 34 |  | 
|---|