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

iplweb / bpp / 0cececd7-a2e7-4a75-a26c-21df764ad54e

24 Aug 2025 10:29PM UTC coverage: 41.169% (-2.5%) from 43.704%
0cececd7-a2e7-4a75-a26c-21df764ad54e

push

circleci

mpasternak
Merge branch 'release/v202508.1206'

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

2674 existing lines in 124 files now uncovered.

16057 of 39003 relevant lines covered (41.17%)

0.76 hits per line

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

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

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

8

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

12

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

16

UNCOV
17
@pytest.mark.django_db
1✔
UNCOV
18
def test_FormRepresentationManager_get_for_instance():
1✔
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():
1✔
24
    a = FormRepresentation()
×
25
    assert str(a) is not None
×
26

27

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

32

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

37

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

42

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

47

UNCOV
48
@pytest.fixture
1✔
UNCOV
49
def test_field_value_repr(test_form, test_form_repr):
1✔
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
1✔
UNCOV
55
def test_FormRepresentation_get_form_class(test_form_repr):
1✔
56
    assert test_form_repr.get_form_class() == TestForm
×
57

58

UNCOV
59
@pytest.mark.django_db
1✔
UNCOV
60
def test_FormFieldDefaultValue_clean_parent_different(
1✔
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
1✔
UNCOV
75
def test_FormFieldDefaultValue_clean_form_class_not_found(
1✔
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
1✔
UNCOV
86
def test_FormFieldDefaultValue_default_value_wrong(
1✔
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