• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

iplweb / bpp / 67f84fd3-e142-4d2b-aa7f-f040679bff5b

11 Aug 2025 01:15PM UTC coverage: 45.341% (+5.5%) from 39.858%
67f84fd3-e142-4d2b-aa7f-f040679bff5b

push

circleci

mpasternak
Merge branch 'release/v202508.1187'

1 of 1 new or added line in 1 file covered. (100.0%)

1383 existing lines in 91 files now uncovered.

17229 of 37999 relevant lines covered (45.34%)

1.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/formdefaults/tests/test_models.py
UNCOV
1
import pytest
×
UNCOV
2
from django import forms
×
UNCOV
3
from django.core.exceptions import ValidationError
×
4

UNCOV
5
from formdefaults.core import update_form_db_repr
×
UNCOV
6
from formdefaults.models import FormRepresentation, FormFieldRepresentation
×
7

8

UNCOV
9
class TestForm(forms.Form):
×
UNCOV
10
    test = forms.IntegerField(label="test1", initial=50)
×
11

12

UNCOV
13
class AnotherTestForm(forms.Form):
×
UNCOV
14
    field = forms.CharField()
×
15

16

UNCOV
17
@pytest.mark.django_db
×
UNCOV
18
def test_FormRepresentationManager_get_for_instance():
×
19
    res = FormRepresentation.objects.get_or_create_for_instance(TestForm())
×
20
    assert res.full_name == "formdefaults.tests.test_models.TestForm"
×
21

22

UNCOV
23
def test_FormRepresentation_str():
×
24
    a = FormRepresentation()
×
25
    assert str(a) is not None
×
26

27

UNCOV
28
def test_FormFieldRepresentation_str():
×
29
    a = FormFieldRepresentation()
×
30
    assert str(a) is not None
×
31

32

UNCOV
33
@pytest.fixture
×
UNCOV
34
def test_form():
×
35
    return TestForm()
×
36

37

UNCOV
38
@pytest.fixture
×
UNCOV
39
def another_test_form_representation():
×
40
    return FormRepresentation.objects.get_or_create_for_instance(AnotherTestForm())
×
41

42

UNCOV
43
@pytest.fixture
×
UNCOV
44
def test_form_repr(test_form):
×
45
    return FormRepresentation.objects.get_or_create_for_instance(test_form)
×
46

47

UNCOV
48
@pytest.fixture
×
UNCOV
49
def test_field_value_repr(test_form, test_form_repr):
×
50
    update_form_db_repr(test_form, test_form_repr)
×
51
    return test_form_repr.values_set.first()
×
52

53

UNCOV
54
@pytest.mark.django_db
×
UNCOV
55
def test_FormRepresentation_get_form_class(test_form_repr):
×
56
    assert test_form_repr.get_form_class() == TestForm
×
57

58

UNCOV
59
@pytest.mark.django_db
×
UNCOV
60
def test_FormFieldDefaultValue_clean_parent_different(
×
61
    test_form_repr, test_field_value_repr, another_test_form_representation
62
):
63
    assert test_field_value_repr.parent == test_form_repr
×
64

65
    test_field_value_repr.parent = None
×
66
    with pytest.raises(ValidationError, match=r".* być określony .*"):
×
67
        test_field_value_repr.clean()
×
68

69
    test_field_value_repr.parent = another_test_form_representation
×
70
    with pytest.raises(ValidationError, match=r".*identyczny.*"):
×
71
        test_field_value_repr.clean()
×
72

73

UNCOV
74
@pytest.mark.django_db
×
UNCOV
75
def test_FormFieldDefaultValue_clean_form_class_not_found(
×
76
    test_form_repr, test_field_value_repr
77
):
78
    test_form_repr.full_name = "123 test"
×
79
    test_form_repr.save()
×
80

81
    with pytest.raises(ValidationError, match=r".* klasy formularza .*"):
×
82
        test_field_value_repr.clean()
×
83

84

UNCOV
85
@pytest.mark.django_db
×
UNCOV
86
def test_FormFieldDefaultValue_default_value_wrong(
×
87
    test_form_repr, test_field_value_repr
88
):
89
    test_field_value_repr.value = "this is not a datetime"
×
90
    with pytest.raises(ValidationError, match=r"Nie udało .*"):
×
91
        test_field_value_repr.clean()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc