{"action":"created","issue":{"url":"https://api.github.com/repos/ilice/OSCapi/issues/204","repository_url":"https://api.github.com/repos/ilice/OSCapi","labels_url":"https://api.github.com/repos/ilice/OSCapi/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/ilice/OSCapi/issues/204/comments","events_url":"https://api.github.com/repos/ilice/OSCapi/issues/204/events","html_url":"https://github.com/ilice/OSCapi/issues/204","id":232059916,"number":204,"title":"Differences between test executions","user":{"login":"teanocrata","id":8138049,"avatar_url":"https://avatars0.githubusercontent.com/u/8138049?v=3","gravatar_id":"","url":"https://api.github.com/users/teanocrata","html_url":"https://github.com/teanocrata","followers_url":"https://api.github.com/users/teanocrata/followers","following_url":"https://api.github.com/users/teanocrata/following{/other_user}","gists_url":"https://api.github.com/users/teanocrata/gists{/gist_id}","starred_url":"https://api.github.com/users/teanocrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teanocrata/subscriptions","organizations_url":"https://api.github.com/users/teanocrata/orgs","repos_url":"https://api.github.com/users/teanocrata/repos","events_url":"https://api.github.com/users/teanocrata/events{/privacy}","received_events_url":"https://api.github.com/users/teanocrata/received_events","type":"User","site_admin":false},"labels":[{"id":360547375,"url":"https://api.github.com/repos/ilice/OSCapi/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-29T16:15:08Z","updated_at":"2017-06-01T05:24:55Z","closed_at":null,"body":"`python manage.py test osc.tests --settings=osc.settings.dev.app_settings`\r\n\r\n`python manage.py test --settings=osc.settings.dev.app_settings`"},"comment":{"url":"https://api.github.com/repos/ilice/OSCapi/issues/comments/305392284","html_url":"https://github.com/ilice/OSCapi/issues/204#issuecomment-305392284","issue_url":"https://api.github.com/repos/ilice/OSCapi/issues/204","id":305392284,"user":{"login":"teanocrata","id":8138049,"avatar_url":"https://avatars0.githubusercontent.com/u/8138049?v=3","gravatar_id":"","url":"https://api.github.com/users/teanocrata","html_url":"https://github.com/teanocrata","followers_url":"https://api.github.com/users/teanocrata/followers","following_url":"https://api.github.com/users/teanocrata/following{/other_user}","gists_url":"https://api.github.com/users/teanocrata/gists{/gist_id}","starred_url":"https://api.github.com/users/teanocrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teanocrata/subscriptions","organizations_url":"https://api.github.com/users/teanocrata/orgs","repos_url":"https://api.github.com/users/teanocrata/repos","events_url":"https://api.github.com/users/teanocrata/events{/privacy}","received_events_url":"https://api.github.com/users/teanocrata/received_events","type":"User","site_admin":false},"created_at":"2017-06-01T05:24:55Z","updated_at":"2017-06-01T05:24:55Z","body":"¿Y los demás test si que te dan lo mismo? Lo digo porque a mi me dan distintos test que en los que quizá sea más sencillo entender qué pasa (por no meter la configuración de elastic de por medio). \r\n\r\n(En ambos casos el error del catastro es correcto, parece que ahora mismo no nos responde, el interesante es el del `test_call_update_parcel_by_catastral_code` que da la sensación de que no usa bien el mock)\r\n\r\nPongo los resultados de ambos:\r\n\r\n## Pasando el módulo\r\n`$ python manage.py test osc.tests --settings=osc.settings.dev.app_settings`\r\n\r\n```\r\ntest_call_inspire_when_get_inspire_data (osc.tests.importer.cadastre_test.InspireImporterTest) ... ok\r\ntest_update_cadastral_information (osc.tests.importer.cadastre_test.InspireImporterTest) ... SKIP: Very very long test\r\ntest_call_update_parcel_by_catastral_code (osc.tests.management.update_parcels_test.UpdateParcelsTest) ... ok\r\ntest_fails_when_there_is_no_parcel_args (osc.tests.management.update_parcels_test.UpdateParcelsTest) ... ok\r\ntest_call_cadastre_when_public_cadastre_info (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_call_get_public_cadastre_info_when_add_public_cadastral_info (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_create_mapping (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_dont_raise_exception_even_when_cadastre_returns_404 (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_get_cadastre_data_from_cadastre_source (osc.tests.services.cadastre_test.CadastreServiceTest) ... ERROR\r\ntest_parse_public_cadastre_response_when_cadastre_returns_error (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_call_inspire_when_get_inspire_data (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_get_inspire_data_from_inspire_source (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_parse_inspire_response_when_inspire_returns_error (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_raise_exception_when_inspire_data_return_404 (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_call_elastic_when_get_aggregated_measures (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_call_elastic_when_get_closest_station (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_aggregated_measures (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_aggregated_measures_from_elastic (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_closest_station (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_closest_station_from_elastic (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_update_parcel_by_catastral_code (osc.tests.services.parcels_test.UpdateParcelTest) ... ok\r\ntest_can_login_into_admin_pages_and_logout_later (osc.tests.functional_test.NewVisitorTest) ... nosetests osc.tests --with-coverage --with-doctest --verbosity=2 --with-html --html-file=./tmp/test/nosetest.html --cover-html --cover-html-dir=./tmp/test/cover --cover-package=osc.services --cover-package=osc.importer --cover-package=osc.management --ignore-files=.*_settings.py\r\nCreating test database for alias 'default'...\r\nDestroying test database for alias 'default'...\r\nok\r\n\r\n======================================================================\r\nERROR: test_get_cadastre_data_from_cadastre_source (osc.tests.services.cadastre_test.CadastreServiceTest)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"D:\\teanocrata\\Development\\OSCapi\\osc\\tests\\services\\cadastre_test.py\", line 133, in test_get_cadastre_data_from_cadastre_source\r\n    self.assertTrue(parcels['control']['cudnp'] == 1, \"should obtain one \"\r\nKeyError: 'control'\r\n-------------------- >> begin captured logging << --------------------\r\nrequests.packages.urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): ovc.catastro.meh.es\r\n--------------------- >> end captured logging << ---------------------\r\n\r\n----------------------------------------------------------------------\r\nHTML: ./tmp/test/nosetest.html\r\nName                                        Stmts   Miss  Cover\r\n---------------------------------------------------------------\r\nosc\\importer\\__init__.py                        1      0   100%\r\nosc\\importer\\cadastre.py                       90      9    90%\r\nosc\\importer\\inforiego.py                     123     94    24%\r\nosc\\management\\__init__.py                      0      0   100%\r\nosc\\management\\commands\\__init__.py             0      0   100%\r\nosc\\management\\commands\\update_parcels.py      13      0   100%\r\nosc\\services\\__init__.py                        5      0   100%\r\nosc\\services\\auth.py                           65     56    14%\r\nosc\\services\\cadastre.py                      261     53    80%\r\nosc\\services\\climate.py                        80      0   100%\r\nosc\\services\\crop.py                           23     14    39%\r\nosc\\services\\feed.py                           19      7    63%\r\nosc\\services\\google.py                         36      9    75%\r\nosc\\services\\parcels.py                        34     13    62%\r\nosc\\services\\soil.py                           19      2    89%\r\nosc\\services\\users.py                          58     49    16%\r\n---------------------------------------------------------------\r\nTOTAL                                         827    306    63%\r\n----------------------------------------------------------------------\r\nRan 22 tests in 7.490s\r\n\r\nFAILED (SKIP=1, errors=1)\r\n```\r\n\r\n## Sin pasarle el módulo\r\n\r\n`$ python manage.py test --settings=osc.settings.dev.app_settings`\r\n\r\n```\r\ntest_call_inspire_when_get_inspire_data (osc.tests.importer.cadastre_test.InspireImporterTest) ... ok\r\ntest_update_cadastral_information (osc.tests.importer.cadastre_test.InspireImporterTest) ... SKIP: Very very long test\r\ntest_call_update_parcel_by_catastral_code (osc.tests.management.update_parcels_test.UpdateParcelsTest) ... FAIL\r\ntest_fails_when_there_is_no_parcel_args (osc.tests.management.update_parcels_test.UpdateParcelsTest) ... ok\r\ntest_call_cadastre_when_public_cadastre_info (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_call_get_public_cadastre_info_when_add_public_cadastral_info (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_create_mapping (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_dont_raise_exception_even_when_cadastre_returns_404 (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_get_cadastre_data_from_cadastre_source (osc.tests.services.cadastre_test.CadastreServiceTest) ... ERROR\r\ntest_parse_public_cadastre_response_when_cadastre_returns_error (osc.tests.services.cadastre_test.CadastreServiceTest) ... ok\r\ntest_call_inspire_when_get_inspire_data (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_get_inspire_data_from_inspire_source (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_parse_inspire_response_when_inspire_returns_error (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_raise_exception_when_inspire_data_return_404 (osc.tests.services.cadastre_test.InspireServiceTest) ... ok\r\ntest_call_elastic_when_get_aggregated_measures (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_call_elastic_when_get_closest_station (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_aggregated_measures (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_aggregated_measures_from_elastic (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_closest_station (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_get_closest_station_from_elastic (osc.tests.services.climate_test.ClimateServiceTest) ... ok\r\ntest_update_parcel_by_catastral_code (osc.tests.services.parcels_test.UpdateParcelTest) ... ok\r\ntest_can_login_into_admin_pages_and_logout_later (osc.tests.functional_test.NewVisitorTest) ... nosetests --with-coverage --with-doctest --verbosity=2 --with-html --html-file=./tmp/test/nosetest.html --cover-html --cover-html-dir=./tmp/test/cover --cover-package=osc.services --cover-package=osc.importer --cover-package=osc.management --ignore-files=.*_settings.py\r\nCreating test database for alias 'default'...\r\nDestroying test database for alias 'default'...\r\nok\r\n\r\n======================================================================\r\nERROR: test_get_cadastre_data_from_cadastre_source (osc.tests.services.cadastre_test.CadastreServiceTest)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"D:\\teanocrata\\Development\\OSCapi\\osc\\tests\\services\\cadastre_test.py\", line 133, in test_get_cadastre_data_from_cadastre_source\r\n    self.assertTrue(parcels['control']['cudnp'] == 1, \"should obtain one \"\r\nKeyError: 'control'\r\n\r\n======================================================================\r\nFAIL: test_call_update_parcel_by_catastral_code (osc.tests.management.update_parcels_test.UpdateParcelsTest)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"D:\\teanocrata\\Development\\OSCapi\\oscenv\\lib\\site-packages\\mock\\mock.py\", line 1305, in patched\r\n    return func(*args, **keywargs)\r\n  File \"D:\\teanocrata\\Development\\OSCapi\\osc\\tests\\management\\update_parcels_test.py\", line 21, in test_call_update_parcel_by_catastral_code\r\n    mock_update_parcel_by_cadastral_code.assert_called_with(cadastral_code)\r\n  File \"D:\\teanocrata\\Development\\OSCapi\\oscenv\\lib\\site-packages\\mock\\mock.py\", line 925, in assert_called_with\r\n    raise AssertionError('Expected call: %s\\nNot called' % (expected,))\r\nAssertionError: Expected call: update_parcel_by_cadastral_code('40167A00805001')\r\nNot called\r\n-------------------- >> begin captured stdout << ---------------------\r\nSuccessfully updated parcel\r\n\r\n--------------------- >> end captured stdout << ----------------------\r\n\r\n----------------------------------------------------------------------\r\nHTML: ./tmp/test/nosetest.html\r\nName                                                 Stmts   Miss  Cover\r\n------------------------------------------------------------------------\r\nosc\\importer\\__init__.py                                 1      0   100%\r\nosc\\importer\\cadastre.py                                90      9    90%\r\nosc\\importer\\inforiego.py                              123     94    24%\r\nosc\\importer\\stations.py                                40     27    33%\r\nosc\\management\\__init__.py                               0      0   100%\r\nosc\\management\\commands\\__init__.py                      0      0   100%\r\nosc\\management\\commands\\create_parcels_mapping.py       11      3    73%\r\nosc\\management\\commands\\delete_tables.py                27     17    37%\r\nosc\\management\\commands\\import_inforiego_daily.py       15      7    53%\r\nosc\\management\\commands\\import_inforiego_hourly.py      15      7    53%\r\nosc\\management\\commands\\import_parcels.py               17      9    47%\r\nosc\\management\\commands\\import_stations.py              13      5    62%\r\nosc\\management\\commands\\import_weather.py               13      5    62%\r\nosc\\management\\commands\\update_parcels.py               13      0   100%\r\nosc\\services\\__init__.py                                 5      0   100%\r\nosc\\services\\auth.py                                    65     56    14%\r\nosc\\services\\cadastre.py                               261     53    80%\r\nosc\\services\\climate.py                                 80      0   100%\r\nosc\\services\\crop.py                                    23     14    39%\r\nosc\\services\\feed.py                                    19      7    63%\r\nosc\\services\\google.py                                  36      9    75%\r\nosc\\services\\parcels.py                                 34     13    62%\r\nosc\\services\\soil.py                                    19      2    89%\r\nosc\\services\\users.py                                   58     49    16%\r\nosc\\services\\weather.py                                 79     57    28%\r\n------------------------------------------------------------------------\r\nTOTAL                                                 1057    443    58%\r\n----------------------------------------------------------------------\r\nRan 22 tests in 9.430s\r\n\r\nFAILED (SKIP=1, errors=1, failures=1)\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"teanocrata"}}