diff --git a/smash/web/forms/worker_form.py b/smash/web/forms/worker_form.py
index 1237b46b5634196b51450b4eada03e0b235d7586..37fa22d1983684b32774911b47245300e6fa81ad 100644
--- a/smash/web/forms/worker_form.py
+++ b/smash/web/forms/worker_form.py
@@ -83,10 +83,10 @@ class WorkerForm(ModelForm):
     def clean(self):
         cleaned_data = super(WorkerForm, self).clean()
         if cleaned_data.get('password', None) is not None:
+            password = cleaned_data['password']
             if cleaned_data['password'] != cleaned_data['password2']:
                 self.add_error('password', "Password don't match")
                 self.add_error('password2', "Password don't match")
-            password = cleaned_data['password']
             min_length = 10
             if len(password) < min_length:
                 self.add_error('password', 'Password must be at least ' + str(min_length) + ' characters long.')
diff --git a/smash/web/tests/forms/test_worker_forms.py b/smash/web/tests/forms/test_worker_forms.py
new file mode 100644
index 0000000000000000000000000000000000000000..90e18947490124a0b31f3e3ea0516fcdafae4535
--- /dev/null
+++ b/smash/web/tests/forms/test_worker_forms.py
@@ -0,0 +1,82 @@
+import logging
+
+from web.models.worker_study_role import ROLE_CHOICES_TECHNICIAN
+from web.models.constants import COUNTRY_OTHER_ID
+from web.forms import WorkerForm
+from web.tests import LoggedInWithWorkerTestCase
+
+logger = logging.getLogger(__name__)
+
+
+class VoucherFormTests(LoggedInWithWorkerTestCase):
+    def setUp(self):
+        super(VoucherFormTests, self).setUp()
+
+    def test_password_miss_match_on_create(self):
+        worker_data = VoucherFormTests.create_valid_worker_data()
+        worker_data["password"] = "test123456x"
+        worker_data["password2"] = "test123456y"
+
+        worker_form = WorkerForm(data=worker_data)
+
+        self.assertFalse(worker_form.is_valid())
+        self.assertTrue("password2" in worker_form.errors)
+
+    def test_password_to_short_on_create(self):
+        worker_data = VoucherFormTests.create_valid_worker_data()
+        worker_data["password"] = "x"
+        worker_data["password2"] = "x"
+
+        worker_form = WorkerForm(data=worker_data)
+
+        self.assertFalse(worker_form.is_valid())
+        self.assertTrue("password" in worker_form.errors)
+
+    def test_password_to_easy_on_create(self):
+        worker_data = VoucherFormTests.create_valid_worker_data()
+        worker_data["password"] = "xxxxxxxxxx"
+        worker_data["password2"] = "xxxxxxxxxx"
+
+        worker_form = WorkerForm(data=worker_data)
+
+        self.assertFalse(worker_form.is_valid())
+        self.assertTrue("password" in worker_form.errors)
+
+    def test_password_to_easy_on_create_2(self):
+        worker_data = VoucherFormTests.create_valid_worker_data()
+        worker_data["password"] = "2222222222"
+        worker_data["password2"] = "2222222222"
+
+        worker_form = WorkerForm(data=worker_data)
+
+        self.assertFalse(worker_form.is_valid())
+        self.assertTrue("password" in worker_form.errors)
+
+    def test_invalid_login_on_create(self):
+        worker_data = VoucherFormTests.create_valid_worker_data()
+        worker_data["login"] = "some login - bla"
+
+        worker_form = WorkerForm(data=worker_data)
+
+        self.assertFalse(worker_form.is_valid())
+        self.assertTrue("login" in worker_form.errors)
+
+    def test_valid_form(self):
+        worker_data = VoucherFormTests.create_valid_worker_data()
+        worker_form = WorkerForm(data=worker_data)
+
+        worker_form.is_valid()
+        self.assertTrue(worker_form.is_valid())
+
+    @staticmethod
+    def create_valid_worker_data():
+        form_data = {
+            "login": "test.login",
+            "password": "test123456",
+            "password2": "test123456",
+            "last_name": "Surname",
+            "first_name": "Given name",
+            "country": COUNTRY_OTHER_ID,
+            "role": ROLE_CHOICES_TECHNICIAN,
+        }
+        return form_data