def test_create_edit_revision(any_added_brand_group1, brand_group_add_values,
                              any_editing_changeset, keywords):
    rev = BrandGroupRevision.clone(data_object=any_added_brand_group1,
                                   changeset=any_editing_changeset)

    for k, v in brand_group_add_values.iteritems():
        assert getattr(rev, k) == v
    assert rev.brand_group is any_added_brand_group1

    assert rev.changeset == any_editing_changeset

    assert rev.source is any_added_brand_group1
    assert rev.source_name == 'brand_group'
def test_create_edit_revision(any_added_brand_group1, brand_group_add_values,
                              any_editing_changeset, keywords):
    rev = BrandGroupRevision.clone(
        data_object=any_added_brand_group1,
        changeset=any_editing_changeset)

    for k, v in brand_group_add_values.iteritems():
        assert getattr(rev, k) == v
    assert rev.brand_group is any_added_brand_group1

    assert rev.changeset == any_editing_changeset

    assert rev.source is any_added_brand_group1
    assert rev.source_name == 'brand_group'
Ejemplo n.º 3
0
def test_create_edit_revision(any_added_brand_group1, brand_group_add_values,
                              any_editing_changeset, keywords):
    rev = BrandGroupRevision.clone(
        data_object=any_added_brand_group1,
        changeset=any_editing_changeset)

    for k, v in brand_group_add_values.items():
        if k == 'keywords':
            # rev.###.keywords.names() gives wrong result for 'Bar', 'bar'
            pub_kws = [k.name for k in rev.brand_group.keywords.all()]
            pub_kws.sort()
            assert pub_kws == keywords['list']
        else:
            assert getattr(rev, k) == v
    assert rev.brand_group is any_added_brand_group1

    assert rev.changeset == any_editing_changeset

    assert rev.source is any_added_brand_group1
    assert rev.source_name == 'brand_group'