Merge "Fixed issue with elevated contexts modifying the original context"

This commit is contained in:
Jenkins
2014-07-16 17:14:39 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import itertools
import copy
from designate.openstack.common import context
from designate.openstack.common import log as logging
@@ -71,7 +72,7 @@ class DesignateContext(context.RequestContext):
'user_identity': user_idt
})
return d
return copy.deepcopy(d)
@classmethod
def from_dict(cls, values):
+4
View File
@@ -15,6 +15,9 @@
# under the License.
from designate.tests import TestCase
from designate import context
from designate.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class TestDesignateContext(TestCase):
@@ -30,3 +33,4 @@ class TestDesignateContext(TestCase):
self.assertFalse(ctxt.is_admin)
self.assertTrue(admin_ctxt.is_admin)
self.assertEqual(0, len(ctxt.roles))