GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 47bd99...6fb05a )
by Alex
02:30
created

TestModels.test_user_password()   A

Complexity

Conditions 3

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
1
#! ../env/bin/python
2
# -*- coding: utf-8 -*-
3
4
import pytest
5
6
from sugarloaf.models import db, User
7
8
create_user = False
9
10
11
@pytest.mark.usefixtures("testapp")
12
class TestModels:
13
    def test_user_save(self, testapp):
14
        """ Test Saving the user model to the database """
15
16
        admin = User('admin', 'supersafepassword')
17
        db.session.add(admin)
18
        db.session.commit()
19
20
        user = User.query.filter_by(username="admin").first()
21
        assert user is not None
22
23
    def test_user_password(self, testapp):
24
        """ Test password hashing and checking """
25
26
        admin = User('admin', 'supersafepassword')
27
28
        assert admin.username == 'admin'
29
        assert admin.check_password('supersafepassword')
30