Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6fe20d19
authored
Apr 24, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: small changes to match django1.6
parent
9741b9ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
circle/dashboard/tests/test_views.py
+2
-3
circle/dashboard/views.py
+4
-3
No files found.
circle/dashboard/tests/test_views.py
View file @
6fe20d19
...
@@ -4,7 +4,6 @@ from unittest import skip
...
@@ -4,7 +4,6 @@ from unittest import skip
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.client
import
Client
from
django.test.client
import
Client
from
django.contrib.auth.models
import
User
,
Group
from
django.contrib.auth.models
import
User
,
Group
from
django.core.exceptions
import
SuspiciousOperation
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.contrib.auth.models
import
Permission
from
django.contrib.auth.models
import
Permission
from
django.contrib.auth
import
authenticate
from
django.contrib.auth
import
authenticate
...
@@ -897,8 +896,8 @@ class TransferOwnershipViewTest(LoginMixin, TestCase):
...
@@ -897,8 +896,8 @@ class TransferOwnershipViewTest(LoginMixin, TestCase):
c2
=
self
.
u2
.
notification_set
.
count
()
c2
=
self
.
u2
.
notification_set
.
count
()
c
=
Client
()
c
=
Client
()
self
.
login
(
c
,
'user2'
)
self
.
login
(
c
,
'user2'
)
with
self
.
assertRaises
(
SuspiciousOperation
):
response
=
c
.
post
(
'/dashboard/vm/1/tx/'
)
c
.
post
(
'/dashboard/vm/1/tx/'
)
assert
response
.
status_code
==
400
self
.
assertEqual
(
self
.
u2
.
notification_set
.
count
(),
c2
)
self
.
assertEqual
(
self
.
u2
.
notification_set
.
count
(),
c2
)
def
test_owned_offer
(
self
):
def
test_owned_offer
(
self
):
...
...
circle/dashboard/views.py
View file @
6fe20d19
...
@@ -30,9 +30,8 @@ from django.template import RequestContext
...
@@ -30,9 +30,8 @@ from django.template import RequestContext
from
django.forms.models
import
inlineformset_factory
from
django.forms.models
import
inlineformset_factory
from
django_tables2
import
SingleTableView
from
django_tables2
import
SingleTableView
from
braces.views
import
(
from
braces.views
import
LoginRequiredMixin
,
SuperuserRequiredMixin
LoginRequiredMixin
,
SuperuserRequiredMixin
,
AccessMixin
from
braces.views._access
import
AccessMixin
)
from
.forms
import
(
from
.forms
import
(
CircleAuthenticationForm
,
DiskAddForm
,
HostForm
,
LeaseForm
,
MyProfileForm
,
CircleAuthenticationForm
,
DiskAddForm
,
HostForm
,
LeaseForm
,
MyProfileForm
,
...
@@ -504,6 +503,7 @@ class OperationView(DetailView):
...
@@ -504,6 +503,7 @@ class OperationView(DetailView):
class
VmOperationView
(
OperationView
):
class
VmOperationView
(
OperationView
):
model
=
Instance
model
=
Instance
context_object_name
=
'instance'
# much simpler to mock object
class
VmMigrateView
(
VmOperationView
):
class
VmMigrateView
(
VmOperationView
):
...
@@ -2274,6 +2274,7 @@ def get_disk_download_status(request, pk):
...
@@ -2274,6 +2274,7 @@ def get_disk_download_status(request, pk):
class
InstanceActivityDetail
(
SuperuserRequiredMixin
,
DetailView
):
class
InstanceActivityDetail
(
SuperuserRequiredMixin
,
DetailView
):
model
=
InstanceActivity
model
=
InstanceActivity
context_object_name
=
'instanceactivity'
# much simpler to mock object
template_name
=
'dashboard/instanceactivity_detail.html'
template_name
=
'dashboard/instanceactivity_detail.html'
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment