{"action":"created","issue":{"url":"https://api.github.com/repos/elliterate/capybara.py/issues/19","repository_url":"https://api.github.com/repos/elliterate/capybara.py","labels_url":"https://api.github.com/repos/elliterate/capybara.py/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/elliterate/capybara.py/issues/19/comments","events_url":"https://api.github.com/repos/elliterate/capybara.py/issues/19/events","html_url":"https://github.com/elliterate/capybara.py/issues/19","id":314369560,"number":19,"title":"Django test cases cooperation","user":{"login":"pkrefta","id":565487,"avatar_url":"https://avatars3.githubusercontent.com/u/565487?v=4","gravatar_id":"","url":"https://api.github.com/users/pkrefta","html_url":"https://github.com/pkrefta","followers_url":"https://api.github.com/users/pkrefta/followers","following_url":"https://api.github.com/users/pkrefta/following{/other_user}","gists_url":"https://api.github.com/users/pkrefta/gists{/gist_id}","starred_url":"https://api.github.com/users/pkrefta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkrefta/subscriptions","organizations_url":"https://api.github.com/users/pkrefta/orgs","repos_url":"https://api.github.com/users/pkrefta/repos","events_url":"https://api.github.com/users/pkrefta/events{/privacy}","received_events_url":"https://api.github.com/users/pkrefta/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-14T23:08:32Z","updated_at":"2018-04-17T17:53:11Z","closed_at":"2018-04-17T17:53:11Z","author_association":"NONE","body":"Hi @elliterate ,\r\n\r\nThanks for your great work. I've configured capybara.py to support my Django app and it works OK. I'm able to visit webpages and basic functions works as expected 👍 \r\n\r\nI've built my tests using `django.test.TestCase` and before visiting some URL i'm adding some items to my database to display them. But unfortunately in browser my application's database is empty.\r\n\r\nMy skeleton looks like this\r\n\r\n```python\r\nimport capybara\r\nimport capybara.dsl\r\nfrom capybara.selenium.driver import Driver\r\nfrom my_project.wsgi import application\r\n\r\nfrom django.test import TestCase\r\n\r\n@capybara.register_driver(\"selenium_chrome\")\r\ndef init_selenium_chrome_driver(app):\r\n    return Driver(app, browser=\"chrome\")\r\n\r\ncapybara.default_driver = \"selenium_chrome\"\r\ncapybara.app = application\r\n\r\n\r\nclass IntegrationTest(TestCase):\r\n    def setUp(self):\r\n        self.page = capybara.dsl.page\r\n\r\n    def tearDown(self):\r\n        capybara.reset_sessions()\r\n\r\n    def test_show_index_page(self):\r\n        # Add some data here\r\n        self.prepare_test_data()        \r\n\r\n        # Unfortunately here, in browser none of test data is available\r\n        self.page.visit('/')\r\n```\r\n\r\nIs this an expected behaviour or am I doing something wrong ?"},"comment":{"url":"https://api.github.com/repos/elliterate/capybara.py/issues/comments/382083877","html_url":"https://github.com/elliterate/capybara.py/issues/19#issuecomment-382083877","issue_url":"https://api.github.com/repos/elliterate/capybara.py/issues/19","id":382083877,"user":{"login":"elliterate","id":6326,"avatar_url":"https://avatars0.githubusercontent.com/u/6326?v=4","gravatar_id":"","url":"https://api.github.com/users/elliterate","html_url":"https://github.com/elliterate","followers_url":"https://api.github.com/users/elliterate/followers","following_url":"https://api.github.com/users/elliterate/following{/other_user}","gists_url":"https://api.github.com/users/elliterate/gists{/gist_id}","starred_url":"https://api.github.com/users/elliterate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elliterate/subscriptions","organizations_url":"https://api.github.com/users/elliterate/orgs","repos_url":"https://api.github.com/users/elliterate/repos","events_url":"https://api.github.com/users/elliterate/events{/privacy}","received_events_url":"https://api.github.com/users/elliterate/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T17:53:11Z","updated_at":"2018-04-17T17:53:11Z","author_association":"OWNER","body":"I was able to write a simple, passing integration test against the Django tutorial app by using `TransactionTestCase`, so I think that's all you need.\r\n\r\nBut if for some reason you're still having trouble, I created [a mailing list](http://groups.google.com/group/capybara-py/) where I'm happy to keep helping.\r\n"}}
{"actor":{"display_login":"elliterate"}}