Beispiel #1
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'
Beispiel #2
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'
 def test_urls(self):
     resp = self.client.get('/overridden_url/')
     self.assertEqual(force_text(resp.content), 'Overridden urlconf works!')
 def test_urls(self):
     resp = self.client.get('/overridden_url/')
     self.assertEqual(force_text(resp.content), 'Overridden urlconf works!')
Beispiel #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"
 def test_url(self, live_server):
     assert live_server.url == force_text(live_server)
 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'
Beispiel #8
0
def test_admin_client_no_db_marker(admin_client):
    assert isinstance(admin_client, Client)
    resp = admin_client.get('/admin-required/')
    assert force_text(resp.content) == 'You are an admin'
 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_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'
Beispiel #11
0
def test_urls_client(client):
    response = client.get('/overridden_url/')
    assert force_text(response.content) == 'Overridden urlconf works!'
Beispiel #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"
Beispiel #13
0
def test_admin_client(admin_client):
    assert isinstance(admin_client, Client)
    resp = admin_client.get("/admin-required/")
    assert force_text(resp.content) == "You are an admin"
Beispiel #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'
 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'
Beispiel #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'
def test_admin_client_no_db_marker(admin_client):
    assert isinstance(admin_client, Client)
    resp = admin_client.get('/admin-required/')
    assert force_text(resp.content) == 'You are an admin'
Beispiel #18
0
 def test_url(self, live_server):
     assert live_server.url == force_text(live_server)
Beispiel #19
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"