예제 #1
0
 def test_get(self, new_asset_category):
     attribute = Attribute(
         _key='description',
         label='description',
         is_required=False,
         input_control='text-area',
         choices='choice'
     )
     new_asset_category.attributes.append(attribute)
     new_asset_category.save()
     attribute.save()
     assert Attribute.get(attribute.id) == attribute
    def test_attributes(self, new_asset_category):
        attribute = Attribute(
            _key='warranty',
            label='warranty',
            is_required=False,
            input_control='text-area',
            choices='choice'
        )

        new_asset_category.attributes.append(attribute)
        attribute.save()
        new_asset_category.save()
        assert new_asset_category.attributes[0] == attribute
예제 #3
0
    def test_attributes(self, init_db, new_risk_type):
        """
            Test that a new risk-type gets associated with an attribute

            Args:
                init_db(SQLAlchemy): fixture to initialize the test database
                new_risk_type (RiskType): Fixture to create a new risk-type
        """

        attribute = Attribute(_key='first_name',
                              label='first_name',
                              is_required=True,
                              input_control='text',
                              choices=None)

        new_risk_type.attributes.append(attribute)
        attribute.save()
        new_risk_type.save()
        assert new_risk_type.attributes[0] == attribute
예제 #4
0
 def test_new_attribute(self, new_asset_category, init_db):
     attribute = Attribute(
         _key='assignee',
         label='assignee',
         is_required=False,
         input_control='text-area',
         choices='choice'
     )
     new_asset_category.attributes.append(attribute)
     new_asset_category.save()
     assert attribute == attribute.save()