Example #1
0
def test_create_objects_from_json_error(json_error, json_success):
    vat_counts = VAT.objects.count()

    with pytest.raises(ImproperlyConfigured):
        utils.create_objects_from_json(json_error)

    utils.create_objects_from_json(json_success)
    assert vat_counts + 1 == VAT.objects.count()
Example #2
0
def test_create_objects_from_json_success(json_success,
                                          json_success_without_reduced_rates):
    for json_dict in [json_success, json_success_without_reduced_rates]:
        utils.create_objects_from_json(json_dict)
    assert VAT.objects.count() == 2