Add functional and unit tests

Updated existing tests to support the
ReceptorAddress model

- cannot peer to self
- cannot peer to node that is already peered to me
- cannot peer to node more than once (via 2+ addresses)
- cannot set is_internal True

Other changes:
Change post save signal to only call
schedule_write_receptor_config() when an actual change is detected.

Make functional tests more robust by
checking for specific validation error in the
response.

I.e. instead of just checking for 400, just for 400
and that the error message corresponds to the
validation we are testing for.

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
Seth Foster
2023-11-14 13:39:24 -05:00
committed by Seth Foster
parent 5385eb0fb3
commit d1cacf64de
5 changed files with 199 additions and 119 deletions

View File

@@ -703,7 +703,7 @@ def generate_config_data():
receptor_config = list(RECEPTOR_CONFIG_STARTER)
for address in addresses:
if address.get_peer_type() and address.is_internal:
if address.get_peer_type():
peer = {
f'{address.get_peer_type()}': {
'address': f'{address.get_full_address()}',