5 # failing to import any of the modules below indicates failed tests
6 # modules used by diaspy
12 #### test suite configuration variables: can be adjusted to your liking
13 # pod used by tests (has to be valid)
14 __pod__
= "http://pod.orkz.net"
17 class ClientTests(unittest
.TestCase
):
20 This test checks initialization of Client() instance.
22 client
= diaspy
.client
.Client(pod
=__pod__
, username
='testuser', password
='testpassword')
23 self
.assertEqual(__pod__
, client
.pod
)
24 self
.assertEqual('testuser', client
._username
)
25 self
.assertEqual('testpassword', client
._password
)
26 self
.assertEqual(client
._token
_regex
, re
.compile(r
'content="(.*?)"\s+name="csrf-token'))
27 self
.assertEqual(client
._login
_data
['user[username]'], 'testuser')
28 self
.assertEqual(client
._login
_data
['user[password]'], 'testpassword')
29 self
.assertEqual(client
._login
_data
['authenticity_token'], client
.get_token())
32 if __name__
== "__main__": unittest
.main()