test_helpers: Add some missing annotations.

This commit is contained in:
Tim Abbott 2016-07-29 15:59:39 -07:00
parent a7086d3d8a
commit 5253c044e7
1 changed files with 4 additions and 1 deletions

View File

@ -335,6 +335,7 @@ class AuthedTestCase(TestCase):
{'username': email, 'password': password}) {'username': email, 'password': password})
def login(self, email, password=None, fails=False): def login(self, email, password=None, fails=False):
# type: (text_type, Optional[text_type], bool) -> HttpResponse
if password is None: if password is None:
password = initial_password(email) password = initial_password(email)
if not fails: if not fails:
@ -519,6 +520,7 @@ class AuthedTestCase(TestCase):
return Message.objects.latest('id') return Message.objects.latest('id')
def get_second_to_last_message(self): def get_second_to_last_message(self):
# type: () -> Message
return Message.objects.all().order_by('-id')[1] return Message.objects.all().order_by('-id')[1]
def get_all_templates(): def get_all_templates():
@ -530,7 +532,8 @@ def get_all_templates():
path_exists = os.path.exists path_exists = os.path.exists
def is_valid_template(p, n): def is_valid_template(p, n):
not n.startswith('.') and not n.startswith('__init__') and isfile(p) # type: (text_type, text_type) -> bool
return not n.startswith('.') and not n.startswith('__init__') and isfile(p)
def process(template_dir, dirname, fnames): def process(template_dir, dirname, fnames):
# type: (str, str, Iterable[str]) -> None # type: (str, str, Iterable[str]) -> None