Misc stuff.

- Legacy-Id: 9954
This commit is contained in:
Henrik Levkowetz 2015-08-01 15:07:49 +00:00
parent a23846c8be
commit 6de3974be7
3 changed files with 35 additions and 1 deletions

1
.gitignore vendored
View file

@ -30,4 +30,5 @@
/lib
/share
/include
/static
/latest-coverage.json

View file

@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
import os.path
#import json
#from pathlib import Path
from textwrap import dedent
from email.mime.text import MIMEText
@ -9,6 +11,8 @@ from email.mime.multipart import MIMEMultipart
from django.conf import settings
from django.test import TestCase
import debug # pyflakes:ignore
from ietf.utils.management.commands import pyflakes
from ietf.utils.mail import send_mail_text, send_mail_mime, outbox
@ -59,3 +63,31 @@ class TestSMTPServer(TestCase):
len_before = len(outbox)
send_complex_mail('good@example.com,poison@example.com')
self.assertEqual(len(outbox),len_before+2)
## One might think that the code below would work, but it doesn't ...
# def list_static_files(path):
# r = Path(settings.STATIC_ROOT)
# p = r / path
# files = list(p.glob('**/*'))
# relfn = [ str(file.relative_to(r)) for file in files ]
# return relfn
#
# class TestBowerStaticFiles(TestCase):
#
# def test_bower_static_file_finder(self):
# from django.templatetags.static import static
# bower_json = os.path.join(settings.BASE_DIR, 'bower.json')
# with open(bower_json) as file:
# bower_info = json.load(file)
# for asset in bower_info["dependencies"]:
# files = list_static_files(asset)
# self.assertGreater(len(files), 0)
# for file in files:
# url = static(file)
# debug.show('url')
# r = self.client.get(url)
# self.assertEqual(r.status_code, 200)

View file

@ -17549,6 +17549,7 @@
"ietf/utils/management/commands/import_htpasswd": 0.0,
"ietf/utils/management/commands/makefixture": 0.0,
"ietf/utils/management/commands/pyflakes": 0.6027397260273972,
"ietf/utils/bower_storage": 0.0,
"ietf/utils/markup_txt": 1.0,
"ietf/utils/ordereddict": 1.0,
"ietf/utils/pipe": 0.875,
@ -18579,4 +18580,4 @@
}
},
"version": "6.2.0"
}
}