Development #22948
oauth2: commande oauth2-put-document pour simplifier les tests de la fonctionnalité
Début:
31 mars 2018
Echéance:
% réalisé:
100%
Temps estimé:
Patch proposed:
Oui
Planning:
Description
Elle permet de créer un lien de dépôt d'un document étant donné un client_id et un fichier.
Fichiers
Révisions associées
Historique
Mis à jour par Benjamin Dauvergne il y a presque 6 ans
- Fichier 0001-oauth2-add-command-oauth2-put-document-fixes-22948.patch 0001-oauth2-add-command-oauth2-put-document-fixes-22948.patch ajouté
- Patch proposed changé de Non à Oui
Mis à jour par Benjamin Dauvergne il y a presque 6 ans
- Fichier 0001-oauth2-add-command-oauth2-put-document-fixes-22948.patch 0001-oauth2-add-command-oauth2-put-document-fixes-22948.patch ajouté
pdb.set_trace() qui traînait retiré.
Mis à jour par Josué Kouka il y a presque 6 ans
Appliqué chez moi juste après #22949
from fargo.fargo.utils import cleanup
importé sans etre utilisé
path = os.path.join(os.path.dirname(__file__), 'pdf-sample.pdf')
un espace en trop
- print 'https://localhost:8000' + make_url(uri, redirect_uri=redirect_uri) + self.stdout.write('https://localhost:8000' + make_url(uri, redirect_uri=redirect_uri))
self.stdout.write
à la place de print
def test_command_put_document(db, capsys, app, john_doe): call_command('oauth2-create-client', 'test', 'https://example.com/') client = OAuth2Client.objects.get() path = os.path.join(os.path.dirname(__file__), 'pdf-sample.pdf') redirect_uri = 'https://example.com/' r = call_command('oauth2-put-document', '--client-id=%s' % client.pk, redirect_uri, path) out, err = capsys.readouterr() assert err == '' url = out.strip() response = app.get(url).follow() response.form.set('username', john_doe.username) response.form.set('password', john_doe.username) response = response.form.submit().follow() assert 'pdf-sample.pdf' in response temp_file = OAuth2TempFile.objects.get() > assert temp_file.uuid in response E AssertionError: assert '873ca89c2883406e9a349884f31e26cc' in <200 OK text/html body='<!DOCTYPE...l>\n'/2465> E + where '873ca89c2883406e9a349884f31e26cc' = <OAuth2TempFile: OAuth2TempFile object>.uuid
Une assertion qui échoue.
Mis à jour par Benjamin Dauvergne il y a presque 6 ans
- Statut changé de En cours à Résolu (à déployer)
- % réalisé changé de 0 à 100
Appliqué par commit a465f2c1769c15511929af5599c7fad0867302dd.
oauth2: add command oauth2-put-document (fixes #22948)