aboutsummaryrefslogtreecommitdiff
path: root/test/unittest
diff options
context:
space:
mode:
authorzsloan2018-03-29 15:46:45 +0000
committerzsloan2018-03-29 15:46:45 +0000
commitfef4b723d0e9d9d0b5f40bd51c6a2cd31410285b (patch)
tree22268c6f4db65f637070319a497de24b82843f0f /test/unittest
parent6ff7df2360d1a6d0461980c938809165982583e8 (diff)
parentb215b5fe5c6d13f0ed445106230e1e38db71c918 (diff)
downloadgenenetwork2-fef4b723d0e9d9d0b5f40bd51c6a2cd31410285b.tar.gz
Resolved conflict in views.py
Diffstat (limited to 'test/unittest')
-rw-r--r--test/unittest/test_registration.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/unittest/test_registration.py b/test/unittest/test_registration.py
new file mode 100644
index 00000000..98d0cdff
--- /dev/null
+++ b/test/unittest/test_registration.py
@@ -0,0 +1,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()