Commit 6fe20d19 by Őry Máté

dashboard: small changes to match django1.6

parent 9741b9ed
......@@ -4,7 +4,6 @@ from unittest import skip
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User, Group
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Permission
from django.contrib.auth import authenticate
......@@ -897,8 +896,8 @@ class TransferOwnershipViewTest(LoginMixin, TestCase):
c2 = self.u2.notification_set.count()
c = Client()
self.login(c, 'user2')
with self.assertRaises(SuspiciousOperation):'/dashboard/vm/1/tx/')
response ='/dashboard/vm/1/tx/')
assert response.status_code == 400
self.assertEqual(self.u2.notification_set.count(), c2)
def test_owned_offer(self):
......@@ -30,9 +30,8 @@ from django.template import RequestContext
from django.forms.models import inlineformset_factory
from django_tables2 import SingleTableView
from braces.views import (
LoginRequiredMixin, SuperuserRequiredMixin, AccessMixin
from braces.views import LoginRequiredMixin, SuperuserRequiredMixin
from braces.views._access import AccessMixin
from .forms import (
CircleAuthenticationForm, DiskAddForm, HostForm, LeaseForm, MyProfileForm,
......@@ -504,6 +503,7 @@ class OperationView(DetailView):
class VmOperationView(OperationView):
model = Instance
context_object_name = 'instance' # much simpler to mock object
class VmMigrateView(VmOperationView):
......@@ -2274,6 +2274,7 @@ def get_disk_download_status(request, pk):
class InstanceActivityDetail(SuperuserRequiredMixin, DetailView):
model = InstanceActivity
context_object_name = 'instanceactivity' # much simpler to mock object
template_name = 'dashboard/instanceactivity_detail.html'
def get_context_data(self, **kwargs):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment