Example #1
0
 def test_client_attribute_is_working_properly(self):
     """testing if the client attribute is working properly
     """
     from stalker.models.client import Client
     client = Client(name='Test Client')
     g = Good(**self.kwargs)
     assert g.client != client
     g.client = client
     assert g.client == client
Example #2
0
    def test_client_attribute_is_set_to_a_value_other_than_a_client(self):
        """testing if a TypeError will be raised when the client attribute is
        set to a value other than a Client instance
        """
        g = Good(**self.kwargs)
        with pytest.raises(TypeError) as cm:
            g.client = 'not a client'

        assert str(cm.value) == \
            'Good.client attribute should be a stalker.models.client.Client ' \
            'instance, not str'