@@ -207,9 +207,7 @@ def test_segments_limit_ignores_old_segment_versions(
207207
208208 # and create some older versions for the segment fixture
209209 segment .clone (is_revision = True )
210- # With the NULL-based canonical representation, only revisions are counted here
211- # (the canonical segment has version_of=None).
212- assert Segment .objects .filter (version_of = segment ).count () == 1
210+ assert Segment .revisions .filter (version_of = segment ).count () == 1
213211 assert Segment .live_objects .count () == 1
214212
215213 url = reverse ("api-v1:projects:project-segments-list" , args = [project .id ])
@@ -1060,13 +1058,11 @@ def test_update_segment_versioned_segment(
10601058 assert response .status_code == status .HTTP_200_OK
10611059
10621060 # Now verify that a new versioned segment has been set.
1063- # With the NULL-based canonical representation, canonical segments have
1064- # version_of=None, so only revisions are counted here.
1065- assert Segment .objects .filter (version_of = segment ).count () == 1
1061+ assert Segment .revisions .filter (version_of = segment ).count () == 1
10661062
10671063 # Now check the previously versioned segment to match former count of conditions.
10681064
1069- versioned_segment = Segment .objects .filter (version_of = segment , version = 1 ).first ()
1065+ versioned_segment = Segment .revisions .filter (version_of = segment , version = 1 ).first ()
10701066 assert versioned_segment != segment
10711067 assert versioned_segment .rules .count () == 1
10721068 versioned_rule = versioned_segment .rules .first ()
@@ -1097,10 +1093,8 @@ def test_update_segment_versioned_segment_with_thrown_exception(
10971093 rule = nested_rule , property = "foo" , operator = EQUAL , value = "bar"
10981094 )
10991095
1100- # With the NULL-based canonical representation, canonical segments have
1101- # version_of=None, so they are not included in this count.
11021096 assert segment .version == 1
1103- assert Segment .objects .filter (version_of = segment ).count () == 0
1097+ assert Segment .revisions .filter (version_of = segment ).count () == 0
11041098
11051099 new_condition_property = "foo2"
11061100 new_condition_value = "bar"
@@ -1153,7 +1147,7 @@ def test_update_segment_versioned_segment_with_thrown_exception(
11531147 # Now verify that the version of the segment has not been changed.
11541148 # The transaction should have rolled back, so no revisions should exist.
11551149 assert segment .version == 1
1156- assert Segment .objects .filter (version_of = segment ).count () == 0
1150+ assert Segment .revisions .filter (version_of = segment ).count () == 0
11571151
11581152
11591153@pytest .mark .parametrize (
0 commit comments