old_contents: 
  from soapbox import xsdspec
  from soapbox.lib.pythonic_testcase import *
  
  
  class XSDSpecElementTest(PythonicTestCase):
      def test_can_render_simple_element(self):
          element = xsdspec.Element()
          element.name = 'Name'
          element.type = 'xs:string'
          
          expected_xml = u'<element name="Name" type="xs:string"/>\n'
          assert_equals(expected_xml, element.xml('element'))
      
      def test_can_render_elements_with_anonymous_simple_types(self):
          element = xsdspec.Element()
          element.name = 'versionNumber'
          element.simpleType = xsdspec.SimpleType(
              restriction=xsdspec.Restriction(
                  base='string',
                  pattern=xsdspec.Pattern(value='\d{2}\.\d{1,2}')
              )
          )
          expected_xml = unicode('<element name="versionNumber">\n'
              '  <simpleType>\n'
              '    <restriction base="string">\n'
              '      <pattern value="\d{2}\.\d{1,2}"/>\n'
              '    </restriction>\n'
              '  </simpleType>\n'
              '</element>\n')
          assert_equals(expected_xml, element.xml('element'))
  
new_contents: 
  from soapbox import xsdspec
  from soapbox.lib.pythonic_testcase import *
  
  
  class XSDSpecElementTest(PythonicTestCase):
      def test_can_render_simple_element(self):
          element = xsdspec.Element()
          element.name = 'Name'
          element.type = 'xs:string'
          
          expected_xml = u'<element name="Name" type="xs:string"/>\n'
          assert_equals(expected_xml, element.xml('element'))
      
      def test_can_render_elements_with_anonymous_simple_types(self):
          element = xsdspec.Element()
          element.name = 'versionNumber'
          element.simpleType = xsdspec.SimpleType(
              restriction=xsdspec.Restriction(
                  base='string',
                  pattern=xsdspec.Pattern(value='\d{2}\.\d{1,2}')
              )
          )
          expected_xml = unicode('<element name="versionNumber">\n'
              '  <simpleType>\n'
              '    <restriction base="string">\n'
              '      <pattern value="\d{2}\.\d{1,2}"/>\n'
              '    </restriction>\n'
              '  </simpleType>\n'
              '</element>\n')
          assert_equals(expected_xml, element.xml('element'))
      
      def test_element_with_ref_attribute_rejects_forbidden_attributes(self):
          self.skipTest('Elements with "ref" attribute currently do not restrict setting other attributes.')
          element = xsdspec.Element()
          element.ref = 'foo'
          element.minOccurs = 3
          element.maxOccurs = '6'
          # element.id (not present in xsdspec.Element)
          
          def set_(attribute, value):
              return lambda: setattr(element, attribute, value)
          assert_raises(ValueError, set_('name', u'bar'))
          assert_raises(ValueError, set_('type', u'xs:string'))
          assert_raises(ValueError, set_('nillable', u'True'))
          
          simple_type = xsdspec.SimpleType(restriction=xsdspec.Restriction(base='string'))
          assert_raises(ValueError, set_('simpleType', simple_type))
          #assert_raises(ValueError, set_('complexType', u'True'))
          
          element.ref = None
          # doesn't raise anymore because we deleted the "ref" attribute
          element.name = u'bar'
  
  
subject: add (currently skipped) test to check that an xsdspec.Element with a "ref" attribute does not accept incompatible attributes such as "name", "type", "nillable"