Пример #1
0
def test_should_return_status_column_value_by_label_with_preference():

    # Arrange
    id = 'status_4'
    column_type = ColumnType.status
    title = 'Status Four'
    label = 'Status 4'

    # Act
    column_value = create_column_value(
        id,
        column_type,
        title,
        label=label,
        index=3,
        settings=o.StatusSettings(**{'labels': {
            '4': "Status 4"
        }}))
    format = column_value.format()

    # Assert
    ok_(column_value != None)
    eq_(column_value.index, 4)
    eq_(column_value.label, label)
    eq_(format, {'label': label})
Пример #2
0
def test_should_return_status_column_value_by_index():

    # Arrange
    id = 'status_2'
    column_type = ColumnType.status
    title = 'Status Two'
    index = 2

    # Act 
    column_value = create_column_value(id, column_type, title, index=index, settings=o.StatusSettings(**{'labels': {'2': 'Status Two'}}))
    format = column_value.format()

    # Assert
    ok_(column_value != None)
    eq_(column_value.index, index)
    eq_(column_value.text, None)
    eq_(format, {'index': index})
Пример #3
0
def test_should_return_status_column_value_by_label():

    # Arrange
    id = 'status_3'
    column_type = ColumnType.status
    title = 'Status Three'
    label = 'Status 3'

    # Act
    column_value = create_column_value(
        id,
        column_type,
        title,
        label=label,
        settings=o.StatusSettings(**{'labels': {
            '3': 'Status 3'
        }}))
    format = column_value.format()

    # Assert
    ok_(column_value != None)
    eq_(column_value.index, 3)
    eq_(column_value.label, label)
    eq_(format, {'label': label})