So that the table (we want a view) is not created and thus does not have to be cleaned up.
Signed-off-by: Cleber Rosa <[email protected]> --- frontend/tko/models.py | 1 + frontend/tko/rpc_interface_unittest.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/tko/models.py b/frontend/tko/models.py index 0c30568..188a9cb 100644 --- a/frontend/tko/models.py +++ b/frontend/tko/models.py @@ -695,3 +695,4 @@ class TestView(dbmodels.Model, model_logic.ModelExtensions): class Meta: db_table = 'tko_test_view_2' + managed = False diff --git a/frontend/tko/rpc_interface_unittest.py b/frontend/tko/rpc_interface_unittest.py index d446ad8..c471bb6 100755 --- a/frontend/tko/rpc_interface_unittest.py +++ b/frontend/tko/rpc_interface_unittest.py @@ -70,11 +70,10 @@ CREATE TABLE "tko_iteration_result" ( def setup_test_view(): """ Django has no way to actually represent a view; we simply create a model for - TestView. This means when we syncdb, Django will create a table for it. - So manually remove that table and replace it with a view. + TestView. So manually create the view. """ cursor = connection.cursor() - cursor.execute('DROP TABLE tko_test_view_2') + cursor.execute('DROP VIEW IF EXISTS tko_test_view_2') cursor.execute(_CREATE_TEST_VIEW) -- 1.7.11.7 _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
