Fix issues caused by dependency upgrades

This commit is contained in:
David Taylor
2017-05-12 21:32:17 +01:00
parent 865bb131a5
commit 36d258253f
3 changed files with 5 additions and 9 deletions

View File

@@ -1,6 +1,5 @@
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
@@ -88,7 +87,7 @@ def nottinghamtec_address_required(function):
def wrap(request, *args, **kwargs):
# Fail if current user's email address isn't @nottinghamtec.co.uk
if not request.user.email.endswith('@nottinghamtec.co.uk'):
error_resp = render_to_response('RIGS/eventauthorisation_request_error.html', context_instance=RequestContext(request))
error_resp = render(request, 'RIGS/eventauthorisation_request_error.html')
return error_resp
return function(request, *args, **kwargs)

View File

@@ -520,9 +520,6 @@ class EventTest(LiveServerTestCase):
self.assertIn("N%05d"%testEvent.pk, infoPanel.find_element_by_xpath('//dt[text()="Based On"]/following-sibling::dd[1]').text)
# Check the PO hasn't carried through
self.assertNotIn("TESTPO", infoPanel.find_element_by_xpath('//dt[text()="PO"]/following-sibling::dd[1]').text)
self.browser.get(self.live_server_url + '/event/' + str(testEvent.pk)) #Go back to the old event
#Check that based-on hasn't crept into the old event
@@ -530,9 +527,6 @@ class EventTest(LiveServerTestCase):
self.assertNotIn("N%05d"%testEvent.pk, infoPanel.find_element_by_xpath('//dt[text()="Based On"]/following-sibling::dd[1]').text)
# Check the PO remains on the old event
self.assertIn("TESTPO", infoPanel.find_element_by_xpath('//dt[text()="PO"]/following-sibling::dd[1]').text)
# Check the items are as they were
table = self.browser.find_element_by_id('item-table') # ID number is known, see above
self.assertIn("Test Item 1", table.text)
@@ -976,6 +970,7 @@ class ClientEventAuthorisationTest(TestCase):
email='teccie@functional.test',
is_superuser=True # lazily grant all permissions
)[0]
self.vatrate = models.VatRate.objects.create(start_at='2014-03-05', rate=0.20, comment='test1')
venue = models.Venue.objects.create(name='Authorisation Test Venue')
client = models.Person.objects.create(name='Authorisation Test Person', email='authorisation@functional.test')
organisation = models.Organisation.objects.create(name='Authorisation Test Organisation', union_account=False)
@@ -1078,6 +1073,7 @@ class TECEventAuthorisationTest(TestCase):
cls.profile.save()
def setUp(self):
self.vatrate = models.VatRate.objects.create(start_at='2014-03-05', rate=0.20, comment='test1')
venue = models.Venue.objects.create(name='Authorisation Test Venue')
client = models.Person.objects.create(name='Authorisation Test Person', email='authorisation@functional.test')
organisation = models.Organisation.objects.create(name='Authorisation Test Organisation', union_account=False)

View File

@@ -360,6 +360,7 @@ class EventPricingTestCase(TestCase):
class EventAuthorisationTestCase(TestCase):
def setUp(self):
models.VatRate.objects.create(rate=0.20, comment="TP V1", start_at='2013-01-01')
self.profile = models.Profile.objects.get_or_create(
first_name='Test',
last_name='TEC User',
@@ -385,7 +386,7 @@ class EventAuthorisationTestCase(TestCase):
self.assertTrue(self.event.authorised)
def test_last_edited(self):
with reversion.create_revision():
with reversion.revisions.create_revision():
auth = models.EventAuthorisation.objects.create(event=self.event, email="authroisation@model.test.case",
name="Test Auth", amount=self.event.total, sent_by=self.profile)
self.assertIsNotNone(auth.last_edited_at)