4
4
from __future__ import annotations
5
5
6
6
from datetime import datetime , timezone
7
- from uuid import UUID
8
-
9
- import pytest
10
- from django .core .exceptions import ValidationError
11
7
12
8
from openedx_learning .apps .authoring .components import api as components_api
9
+ from openedx_learning .apps .authoring .components .models import Component , ComponentType
13
10
from openedx_learning .apps .authoring .linking import api as linking_api
14
11
from openedx_learning .apps .authoring .linking .models import CourseLinksStatus , PublishableEntityLink
15
12
from openedx_learning .apps .authoring .publishing import api as publishing_api
16
13
from openedx_learning .apps .authoring .publishing .models import LearningPackage
17
- from openedx_learning .apps .authoring .components .models import Component , ComponentType
18
14
from openedx_learning .lib .test_utils import TestCase
19
15
20
16
@@ -71,16 +67,16 @@ def test_update_or_create_entity_link(self) -> None:
71
67
"version_synced" : 1 ,
72
68
}
73
69
# Should create new link
74
- link = linking_api .update_or_create_entity_link (self .html_component , ** entity_args )
70
+ link = linking_api .update_or_create_entity_link (self .html_component , ** entity_args ) # type: ignore[arg-type]
75
71
assert PublishableEntityLink .objects .filter (downstream_usage_key = downstream_usage_key ).exists ()
76
72
prev_updated_time = link .updated
77
73
# Using the api with same arguments should not make any changes
78
- link = linking_api .update_or_create_entity_link (self .html_component , ** entity_args )
74
+ link = linking_api .update_or_create_entity_link (self .html_component , ** entity_args ) # type: ignore[arg-type]
79
75
assert link .updated == prev_updated_time
80
76
# update version_synced field
81
77
link = linking_api .update_or_create_entity_link (
82
78
self .html_component ,
83
- ** {** entity_args , "version_synced" : 2 }
79
+ ** {** entity_args , "version_synced" : 2 } # type: ignore[arg-type]
84
80
)
85
81
assert link .updated != prev_updated_time
86
82
assert link .version_synced == 2
@@ -98,7 +94,7 @@ def test_delete_entity_link(self) -> None:
98
94
"version_synced" : 1 ,
99
95
}
100
96
# Should create new link
101
- linking_api .update_or_create_entity_link (self .html_component , ** entity_args )
97
+ linking_api .update_or_create_entity_link (self .html_component , ** entity_args ) # type: ignore[arg-type]
102
98
assert PublishableEntityLink .objects .filter (downstream_usage_key = downstream_usage_key ).exists ()
103
99
linking_api .delete_entity_link (downstream_usage_key )
104
100
assert not PublishableEntityLink .objects .filter (downstream_usage_key = downstream_usage_key ).exists ()
0 commit comments