{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/250","labels_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/250/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/250/events","html_url":"https://github.com/pytest-dev/pytest-django/issues/250","id":97491448,"number":250,"title":"Queries with related managers don't raise an exception when the test is not marked with django_db","user":{"login":"thedrow","id":48936,"avatar_url":"https://avatars.githubusercontent.com/u/48936?v=3","gravatar_id":"","url":"https://api.github.com/users/thedrow","html_url":"https://github.com/thedrow","followers_url":"https://api.github.com/users/thedrow/followers","following_url":"https://api.github.com/users/thedrow/following{/other_user}","gists_url":"https://api.github.com/users/thedrow/gists{/gist_id}","starred_url":"https://api.github.com/users/thedrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thedrow/subscriptions","organizations_url":"https://api.github.com/users/thedrow/orgs","repos_url":"https://api.github.com/users/thedrow/repos","events_url":"https://api.github.com/users/thedrow/events{/privacy}","received_events_url":"https://api.github.com/users/thedrow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T15:35:58Z","updated_at":"2015-08-14T15:21:24Z","closed_at":null,"body":"Here's a simple test case to reproduce the problem:\r\n```python\r\nclass Bar(models.model):\r\n  pass\r\nclass Foo(models.Model):\r\n  bar = models.ManyToMany(Bar)\r\ndef test():\r\n  foo = Foo()\r\n  foo.pk = 1\r\n  foo.bar.all()\r\n```\r\n\r\nI expected to get an exception like any other database operation."},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/comments/131146270","html_url":"https://github.com/pytest-dev/pytest-django/issues/250#issuecomment-131146270","issue_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/250","id":131146270,"user":{"login":"Stranger6667","id":1236561,"avatar_url":"https://avatars.githubusercontent.com/u/1236561?v=3","gravatar_id":"","url":"https://api.github.com/users/Stranger6667","html_url":"https://github.com/Stranger6667","followers_url":"https://api.github.com/users/Stranger6667/followers","following_url":"https://api.github.com/users/Stranger6667/following{/other_user}","gists_url":"https://api.github.com/users/Stranger6667/gists{/gist_id}","starred_url":"https://api.github.com/users/Stranger6667/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stranger6667/subscriptions","organizations_url":"https://api.github.com/users/Stranger6667/orgs","repos_url":"https://api.github.com/users/Stranger6667/repos","events_url":"https://api.github.com/users/Stranger6667/events{/privacy}","received_events_url":"https://api.github.com/users/Stranger6667/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T15:21:24Z","updated_at":"2015-08-14T15:21:24Z","body":"Probably it is because querysets are lazy. If you will try to evaluate it, then you will get error."}}