{"action":"created","issue":{"url":"https://api.github.com/repos/django-nose/django-nose/issues/292","repository_url":"https://api.github.com/repos/django-nose/django-nose","labels_url":"https://api.github.com/repos/django-nose/django-nose/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/django-nose/django-nose/issues/292/comments","events_url":"https://api.github.com/repos/django-nose/django-nose/issues/292/events","html_url":"https://github.com/django-nose/django-nose/issues/292","id":318963091,"number":292,"title":"Oracle backend issue with test settings","user":{"login":"danizen","id":4966193,"avatar_url":"https://avatars2.githubusercontent.com/u/4966193?v=4","gravatar_id":"","url":"https://api.github.com/users/danizen","html_url":"https://github.com/danizen","followers_url":"https://api.github.com/users/danizen/followers","following_url":"https://api.github.com/users/danizen/following{/other_user}","gists_url":"https://api.github.com/users/danizen/gists{/gist_id}","starred_url":"https://api.github.com/users/danizen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danizen/subscriptions","organizations_url":"https://api.github.com/users/danizen/orgs","repos_url":"https://api.github.com/users/danizen/repos","events_url":"https://api.github.com/users/danizen/events{/privacy}","received_events_url":"https://api.github.com/users/danizen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-30T17:04:18Z","updated_at":"2018-04-30T20:28:13Z","closed_at":null,"author_association":"NONE","body":"## DESIRED BEHAVIOR\r\n\r\n*All* test settings, rather than just the database name, will be copied for oracle tests, because a schema is the main way to vary the tests.   This is also desirable as an option for PostgreSQL.\r\n\r\n`REUSE_DB` will default to off for Oracle, because Oracle has the `CREATE_DB` and `CREATE_USER` options.\r\n\r\n## ACTUAL BEHAVIOR\r\n\r\nOnly the ``NAME`` of the Oracle connection is copied, meaning that our TNS names must map 1-to-1 with projects, preventing our previous environment from working.\r\n\r\nWhen I run my tests using Oracle backend, it runs against the main database rather than the test database:\r\n\r\n```python\r\nDATABASES = {\r\n    'default': {\r\n        'ENGINE': 'django.db.backends.oracle',\r\n        'NAME': 'MEDPLUS_DEV',\r\n        'USER': _schema,\r\n        'PASSWORD': _password,\r\n        'HOST': '',\r\n        'PORT': '',\r\n        'TEST': {\r\n            'CREATE_DB': False,\r\n            'CREATE_USER': False,\r\n            'USER': _test_schema,\r\n            'NAME': 'MEDPLUS_DEV',\r\n            'PASSWORD': _test_password,\r\n        },\r\n    }\r\n}\r\n```\r\n\r\nWhen I run the test --pdb, I can verify that the current schema shows that I'm still in the main development schema, rather than the test schema:\r\n\r\n```\r\n$ ./manage.py test mplusmon.tests.test_tags --pdb                                                                                                               \r\nnosetests mplusmon.tests.test_tags --rednose --with-xunit --xunit-file C:\\Users\\davisda4\\workspace\\mplusmonitor\\reports\\python-unit-tests.xml --with-coverage --\r\ncover-package mplusmon,ng_loader,conf --pdb --verbosity=1                                                                                                       \r\n....> c:\\tools\\python\\3.5\\lib\\unittest\\case.py(813)_baseAssertEqual()                                                                                           \r\n-> raise self.failureException(msg)                                                                                                                             \r\n(Pdb) up                                                                                                                                                        \r\n> c:\\tools\\python\\3.5\\lib\\unittest\\case.py(820)assertEqual()                                                                                                    \r\n-> assertion_func(first, second, msg=msg)                                                                                                                       \r\n(Pdb) up                                                                                                                                                        \r\n> c:\\users\\davisda4\\workspace\\mplusmonitor\\mplusmon\\tests\\test_tags.py(30)test_tags_list()                                                                      \r\n-> self.assertEqual(len(taglist), 2)                                                                                                                            \r\n(Pdb) from django.db import connection                                                                                                                          \r\n(Pdb) cursor = connection.cursor()                                                                                                                              \r\n(Pdb) cursor.execute(\"SELECT sys_context('userenv', 'current_schema') from dual;\")                                                                              \r\n<cx_Oracle.Cursor on <cx_Oracle.Connection to mplusmon_dev@MEDPLUS_DEV>>                                                                                        \r\n(Pdb) for row in cursor: print(row)                                                                                                                             \r\n('MPLUSMON_DEV',)                                                                                                                                               \r\n(Pdb)                                                                                                                                                           \r\n```\r\n\r\n## WORKAROUND\r\n\r\n- Use earlier version of django-nose\r\n- Write our own TestSuiteRunner that extends TestSuiteRunner\r\n- Change the settings to use the 'django_nose.BasicNoseRunner':\r\n\r\n```python\r\nTEST_RUNNER = 'django_nose.BasicNoseRunner'\r\n```\r\n\r\n                                          \r\n"},"comment":{"url":"https://api.github.com/repos/django-nose/django-nose/issues/comments/385518678","html_url":"https://github.com/django-nose/django-nose/issues/292#issuecomment-385518678","issue_url":"https://api.github.com/repos/django-nose/django-nose/issues/292","id":385518678,"user":{"login":"danizen","id":4966193,"avatar_url":"https://avatars2.githubusercontent.com/u/4966193?v=4","gravatar_id":"","url":"https://api.github.com/users/danizen","html_url":"https://github.com/danizen","followers_url":"https://api.github.com/users/danizen/followers","following_url":"https://api.github.com/users/danizen/following{/other_user}","gists_url":"https://api.github.com/users/danizen/gists{/gist_id}","starred_url":"https://api.github.com/users/danizen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danizen/subscriptions","organizations_url":"https://api.github.com/users/danizen/orgs","repos_url":"https://api.github.com/users/danizen/repos","events_url":"https://api.github.com/users/danizen/events{/privacy}","received_events_url":"https://api.github.com/users/danizen/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T20:28:13Z","updated_at":"2018-04-30T20:28:13Z","author_association":"NONE","body":"Dropping this complaint - I found that I had {{REUSE_DB}} set to 1 in my {{./manage.py}}, and so I was telling it to skip testdb creation, and therefore also skip migrations."}}
{"actor":{"display_login":"danizen"}}