aboutsummaryrefslogtreecommitdiff
path: root/test/unittest/test_registration.py
blob: 98d0cdffa0c028a5ea01f4f2a827e45a88343f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Run test with something like
#
# env GN2_PROFILE=~/opt/gn-latest GENENETWORK_FILES=$HOME/gn2_data ./bin/genenetwork2 ./etc/default_settings.py -c ../test/unittest/test_registration.py
#

import unittest
import mock.es_double as es
from wqflask.user_manager import RegisterUser

class TestRegisterUser(unittest.TestCase):
    def setUp(self):
        self.es = es.ESDouble()

    def testRegisterUserWithCorrectData(self):
        data = {
            "email_address": "user@example.com"
            , "full_name": "A.N. Other"
            , "organization": "Some Organisation"
            , "password": "testing"
            , "password_confirm": "testing"
            , "es_connection": self.es
        }
        result = RegisterUser(data)
        self.assertEqual(len(result.errors), 0, "Errors were not expected")

if __name__ == "__main__":
    unittest.main()