from django.test import SimpleTestCase import json import requests url = "http://127.0.0.1:8000/Tierra_2/alm01/" headers = {'content-type': 'application/json'} # Create your tests here. class Alm01TestCase(SimpleTestCase): def test_alm01_savePhotoFtp(self): print("############# savePhotoFtp #############") resultado = requests.post(url + "savephoto/", data=json.dumps({"mission":"misionTestUnitario", "source":"c:/tierra2/foto/"}), headers=headers) print("test_alm01_savePhotoFtp:" + resultado.text) self.assertTrue(str(resultado.content).find('Ficheros subidos correctamente!') >= 0)