Hi,
I have recently upgraded to sjango 1.8 and I have 2 models with a bi-directional ManyToMany field. It looks like this
class Pizza(Model):
available_toppings = ManyToManyField('Topping')
class Topping(Model):
all_pizzas = ManyToManyField(Pizza, through=Pizza.available_stoppings.through, verbose_name='available pizzas')
Everything was fine in django 1.7 but right now when running tests, specifically when creating the test database, I get this exception:
self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x7fd24fca4b00>
def execute(self, query, params=None):
if params is None:
> return Database.Cursor.execute(self, query)
E OperationalError: table "products_pizza_available_toppings" already exists
So it looks like the creation of the test database is trying to re-create the intermediate table for the ManyToMany.
I do not get any exception when running my site.
Does anyone know how can I fix this?
Thank you in advance