Add functional API tests

add tests for calling write_receptor_config

add write_receptor_config test

Do not set default listener_port on control node
This commit is contained in:
Seth Foster
2023-06-20 15:47:13 -04:00
committed by Seth Foster
parent 80df31fc4e
commit 2a51f23b7d
7 changed files with 458 additions and 61 deletions

View File

@@ -5506,6 +5506,9 @@ class InstanceSerializer(BaseSerializer):
return super().validate(attrs)
def validate_node_type(self, value):
if not self.instance and value not in [Instance.Types.HOP, Instance.Types.EXECUTION]:
raise serializers.ValidationError("Can only create execution nodes.")
if self.instance and self.instance.node_type != value:
raise serializers.ValidationError(_("Cannot change node type."))