| | 120 | ############################################### |
|---|
| | 121 | # Test for ticket #7572 -- MySQL has a problem if the same connection is |
|---|
| | 122 | # used to create tables, load data, and then query over that data. |
|---|
| | 123 | # To compensate, we close the connection after running loaddata. |
|---|
| | 124 | # This ensures that a new connection is opened when test queries are issued. |
|---|
| | 125 | |
|---|
| | 126 | >>> management.call_command('loaddata', 'big-fixture.json', verbosity=0) |
|---|
| | 127 | |
|---|
| | 128 | >>> articles = Article.objects.exclude(id=9) |
|---|
| | 129 | >>> articles.values_list('id', flat=True) |
|---|
| | 130 | [1, 2, 3, 4, 5, 6, 7, 8] |
|---|
| | 131 | |
|---|
| | 132 | # Just for good measure, run the same query again. Under the influence of |
|---|
| | 133 | # ticket #7572, this will give a different result to the previous call. |
|---|
| | 134 | >>> articles.values_list('id', flat=True) |
|---|
| | 135 | [1, 2, 3, 4, 5, 6, 7, 8] |
|---|
| | 136 | |
|---|