Remove some tests

ugh, this is the wrong direction, but seems practical in this case since the
tests didn't accomplish much
This commit is contained in:
Lance Edgar 2018-10-17 19:42:54 -05:00
parent 5a9fedbb9a
commit fd15865d0b

View file

@ -1,8 +1,10 @@
# -*- coding: utf-8; -*-
from __future__ import unicode_literals, absolute_import
from unittest import TestCase
from mock import Mock
from pyramid import testing
from tailbone import subscribers
@ -13,27 +15,3 @@ class SubscribersTests(TestCase):
event = Mock()
event.__setitem__ = Mock()
subscribers.before_render(event)
class TestAddRattailConfigAttributeToRequest(TestCase):
def test_nothing_is_done_if_no_config_in_registry_settings(self):
request = testing.DummyRequest()
config = testing.setUp(request=request)
self.assertFalse('rattail_config' in request.registry.settings)
self.assertFalse(hasattr(request, 'rattail_config'))
event = Mock(request=request)
subscribers.add_rattail_config_attribute_to_request(event)
self.assertFalse(hasattr(request, 'rattail_config'))
testing.tearDown()
def test_attribute_added_if_config_present_in_registry_settings(self):
rattail_config = Mock()
request = testing.DummyRequest()
config = testing.setUp(request=request, settings={'rattail_config': rattail_config})
self.assertTrue('rattail_config' in request.registry.settings)
self.assertFalse(hasattr(request, 'rattail_config'))
event = Mock(request=request)
subscribers.add_rattail_config_attribute_to_request(event)
self.assertTrue(request.rattail_config is rattail_config)
testing.tearDown()