def test_serve_static_dj17_without_staticfiles_app(self, live_server, settings): """ Because ``django.contrib.staticfiles`` is not installed LiveServer can not serve statics with django >= 1.7 . """ with pytest.raises(HTTPError): urlopen(live_server + "/static/a_file.txt").read()
def test_fixture_transactional_db(self, transactional_db, live_server): Item.objects.create(name='foo') response_data = urlopen(live_server + '/item_count/').read() assert force_text(response_data) == 'Item count: 1'
def test_db_changes_visibility(self, live_server): response_data = urlopen(live_server + '/item_count/').read() assert force_text(response_data) == 'Item count: 0' Item.objects.create(name='foo') response_data = urlopen(live_server + '/item_count/').read() assert force_text(response_data) == 'Item count: 1'
def test_item_db(self, item_db, live_server): response_data = urlopen(live_server + "/item_count/").read() assert force_text(response_data) == "Item count: 1"
def test_fixture_db(self, db, live_server): Item.objects.create(name="foo") response_data = urlopen(live_server + "/item_count/").read() assert force_text(response_data) == "Item count: 1"
def test_db_changes_visibility(self, live_server): response_data = urlopen(live_server + "/item_count/").read() assert force_text(response_data) == "Item count: 0" Item.objects.create(name="foo") response_data = urlopen(live_server + "/item_count/").read() assert force_text(response_data) == "Item count: 1"
def test_serve_static(self, live_server, settings): """ Test that the LiveServer serves static files by default. """ response_data = urlopen(live_server + '/static/a_file.txt').read() assert force_text(response_data) == 'bla\n'
def test_item_transactional_db(self, item_transactional_db, live_server): response_data = urlopen(live_server + '/item_count/').read() assert force_text(response_data) == 'Item count: 1'
def test_item_transactional_db(self, item_transactional_db, live_server): response_data = urlopen(live_server + "/item_count/").read() assert force_str(response_data) == "Item count: 1"