Skip to content

Commit a2238b3

Browse files
author
Matthew Fisher
committed
test(controller): add unit test for deleting domains
.get_object() returns all domains instead of the requested domain, which causes an issue when attempting to delete or modify a specific domain.
1 parent ce4f8c3 commit a2238b3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

controller/api/tests/test_domain.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import unicode_literals
88

99
import json
10+
import unittest
1011

1112
from django.contrib.auth.models import User
1213
from django.test import TestCase
@@ -101,6 +102,12 @@ def test_delete_domain_does_not_remove_latest(self):
101102
with self.assertRaises(Domain.DoesNotExist):
102103
Domain.objects.get(domain=test_domains[0])
103104

105+
@unittest.skip(".get_object() returns all domains instead of the requested domain")
106+
def test_delete_domain_does_not_remove_others(self):
107+
"""https://github.com/deis/deis/issues/3475"""
108+
self.test_delete_domain_does_not_remove_latest()
109+
self.assertEqual(Domain.objects.all().count(), 1)
110+
104111
def test_manage_domain_invalid_app(self):
105112
url = '/v1/apps/{app_id}/domains'.format(app_id="this-app-does-not-exist")
106113
body = {'domain': 'test-domain.example.com'}

0 commit comments

Comments
 (0)