예제 #1
0
 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()
예제 #2
0
 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()
예제 #3
0
 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'
예제 #4
0
 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'
예제 #5
0
 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"
예제 #6
0
 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"
예제 #7
0
 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"
예제 #8
0
 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"
예제 #9
0
 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'
예제 #10
0
 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'
예제 #11
0
 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'
예제 #12
0
 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'
예제 #13
0
 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"
예제 #14
0
 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'
예제 #15
0
 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"
예제 #16
0
 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'
예제 #17
0
 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"