@@ -0,0 +1,1030 @@
+#!flask/bin/python3.5%0A%0Aimport os%0Aimport unittest%0A%0Afrom config import basedir%0Afrom app import app, db%0Afrom app.models import User%0A%0Aclass TestCase(unittest.TestCase):%0A%0A    def setUp(self):%0A        app.config%5B'TESTING'%5D = True%0A        app.config%5B'WTF_CSRF_ENABLED'%5D = False%0A        app.config%5B'SQLALCHEMY_DATABASE_URI'%5D = 'sqlite:///' + os.path.join(basedir, 'test.db')%0A        self.app = app.test_client()%0A        db.create_all()%0A%0A    def tearDown(self):%0A        db.session.remove()%0A        db.drop_all()%0A        %0A    def test_make_unique_nickname(self):%0A        u = User(social_id='12345', nickname='john')%0A        db.session.add(u)%0A        db.session.commit()%0A        nickname = User.make_unique_nickname('john')%0A        assert nickname != 'john'%0A        u = User(social_id='23456', nickname=nickname)%0A        db.session.add(u)%0A        db.session.commit()%0A        nickname2 = User.make_unique_nickname('john')%0A        assert nickname2 != 'john'%0A        assert nickname2 != nickname%0A%0Aif __name__ == %22__main__%22:%0A    unittest.main()%0A

add unittest for make_unique_nickname