@@ -105,9 +105,9 @@ class TopicAPITestCase(ClearContentTypesTransactionTestCase):
105
105
fixtures = ['projects.json' ]
106
106
107
107
def setUp (self ):
108
- self .user = User .objects .get (username = 'barry' )
108
+ self .user = User .objects .get (email = 'barry@example.com ' )
109
109
self .project = Project .objects .get (slug = 'emma' )
110
- self .client .login (username = 'barry' , password = 'barry' )
110
+ self .client .login (username = 'barry@example.com ' , password = 'barry' )
111
111
112
112
def create_test_topic (self ):
113
113
data = TEST_TOPIC .copy ()
@@ -154,7 +154,7 @@ def test_topic_api_create(self):
154
154
155
155
# 'time': ???,
156
156
expected = {
157
- 'user ' : 'barry' ,
157
+ 'user_id ' : 1 ,
158
158
'project' : 'emma' ,
159
159
'type' : topic_obj ._meta .model_name ,
160
160
'url' : topic_obj .get_absolute_url (),
@@ -175,7 +175,7 @@ def test_topic_api_create(self):
175
175
def test_topic_api_create_bad_permissions (self ):
176
176
"Creating a topic in an outside project is NOT OK"
177
177
self .client .logout ()
178
- self .client .login (username = 'esther' , password = 'esther' )
178
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
179
179
response = self .client .post (
180
180
reverse ('api:topics-list' , args = [self .project .slug ]),
181
181
json .dumps (TEST_TOPIC ),
@@ -236,7 +236,7 @@ def test_topic_api_list(self):
236
236
def test_topic_api_list_other_projects (self ):
237
237
"Other projects' topic lists should be viewable, even if logged out"
238
238
self .client .logout ()
239
- self .client .login (username = 'esther' , password = 'esther' )
239
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
240
240
response = self .client .get (reverse ('api:topics-list' ,
241
241
args = [self .project .slug ]),
242
242
HTTP_ACCEPT = 'application/json' )
@@ -283,7 +283,7 @@ def test_topic_api_update(self):
283
283
284
284
# 'time': ???,
285
285
expected = {
286
- 'user ' : 'barry' ,
286
+ 'user_id ' : 1 ,
287
287
'project' : 'emma' ,
288
288
'type' : updated_topic_obj ._meta .model_name ,
289
289
'url' : updated_topic_obj .get_absolute_url (),
@@ -303,7 +303,7 @@ def test_topic_api_update_bad_permissions(self):
303
303
data ['markup' ] = u'a bad, garbage guy'
304
304
305
305
self .client .logout ()
306
- self .client .login (username = 'esther' , password = 'esther' )
306
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
307
307
308
308
response = self .client .put (
309
309
reverse ('api:topics-detail' ,
@@ -352,7 +352,7 @@ def test_topic_api_delete(self):
352
352
353
353
# 'time': ???,
354
354
expected = {
355
- 'user ' : 'barry' ,
355
+ 'user_id ' : 1 ,
356
356
'project' : 'emma' ,
357
357
'type' : topic_obj ._meta .model_name ,
358
358
'url' : None ,
@@ -367,7 +367,7 @@ def test_topic_api_delete_bad_permissions(self):
367
367
"Deleting a topic in an outside project is NOT OK"
368
368
topic_obj = create_topic (user = self .user , project = self .project )
369
369
self .client .logout ()
370
- self .client .login (username = 'esther' , password = 'esther' )
370
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
371
371
372
372
response = self .client .delete (
373
373
reverse ('api:topics-detail' ,
@@ -393,9 +393,9 @@ class DocumentAPITestCase(ClearContentTypesTransactionTestCase):
393
393
fixtures = ['projects.json' ]
394
394
395
395
def setUp (self ):
396
- self .user = User .objects .get (username = 'barry' )
396
+ self .user = User .objects .get (email = 'barry@example.com ' )
397
397
self .project = Project .objects .get (slug = 'emma' )
398
- self .client .login (username = 'barry' , password = 'barry' )
398
+ self .client .login (username = 'barry@example.com ' , password = 'barry' )
399
399
400
400
def create_test_document (self ):
401
401
data = TEST_DOCUMENT
@@ -426,7 +426,7 @@ def test_document_api_create_bad_permissions(self):
426
426
"Creating a document in another project is NOT OK"
427
427
data = TEST_DOCUMENT .copy ()
428
428
self .client .logout ()
429
- self .client .login (username = 'esther' , password = 'esther' )
429
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
430
430
response = self .client .post (
431
431
reverse ('api:documents-list' , args = [self .project .slug ]),
432
432
json .dumps (data ),
@@ -483,7 +483,7 @@ def test_document_api_list(self):
483
483
original_response_content = response .data
484
484
485
485
self .client .logout ()
486
- self .client .login (username = 'esther' , password = 'esther' )
486
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
487
487
response = self .client .get (reverse ('api:documents-list' ,
488
488
args = [self .project .slug ]),
489
489
HTTP_ACCEPT = 'application/json' )
@@ -533,7 +533,7 @@ def test_document_api_update_bad_permissions(self):
533
533
document_obj = create_document (
534
534
project = self .project , creator = self .user , last_updater = self .user )
535
535
self .client .logout ()
536
- self .client .login (username = 'esther' , password = 'esther' )
536
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
537
537
538
538
data = TEST_DOCUMENT .copy ()
539
539
data ['description' ] = u'a stupid book!!!!!!!'
@@ -581,7 +581,7 @@ def test_document_api_delete_bad_permissions(self):
581
581
document_obj = create_document (
582
582
project = self .project , creator = self .user , last_updater = self .user )
583
583
self .client .logout ()
584
- self .client .login (username = 'esther' , password = 'esther' )
584
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
585
585
response = self .client .delete (
586
586
reverse ('api:documents-detail' ,
587
587
args = [self .project .slug , document_obj .id ]),
@@ -608,9 +608,9 @@ class NoteAPITestCase(ClearContentTypesTransactionTestCase):
608
608
fixtures = ['projects.json' ]
609
609
610
610
def setUp (self ):
611
- self .user = User .objects .get (username = 'barry' )
611
+ self .user = User .objects .get (email = 'barry@example.com ' )
612
612
self .project = Project .objects .get (slug = 'emma' )
613
- self .client .login (username = 'barry' , password = 'barry' )
613
+ self .client .login (username = 'barry@example.com ' , password = 'barry' )
614
614
615
615
def create_test_note (self ):
616
616
data = TEST_NOTE
@@ -670,7 +670,7 @@ def test_note_api_create_bad_permissions(self):
670
670
"Creating a note in an outside project is NOT OK"
671
671
data = TEST_NOTE .copy ()
672
672
self .client .logout ()
673
- self .client .login (username = 'esther' , password = 'esther' )
673
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
674
674
response = self .client .post (
675
675
reverse ('api:notes-list' , args = [self .project .slug ]),
676
676
json .dumps (data ),
@@ -723,7 +723,7 @@ def test_note_api_list(self):
723
723
original_response_content = response .data
724
724
725
725
self .client .logout ()
726
- self .client .login (username = 'esther' , password = 'esther' )
726
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
727
727
response = self .client .get (reverse ('api:notes-list' ,
728
728
args = [self .project .slug ]),
729
729
HTTP_ACCEPT = 'application/json' )
@@ -764,7 +764,7 @@ def test_note_api_update_bad_permissions(self):
764
764
"Updating a note in an outside project is NOT OK"
765
765
note_obj = self .create_test_note ()
766
766
self .client .logout ()
767
- self .client .login (username = 'esther' , password = 'esther' )
767
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
768
768
data = TEST_NOTE .copy ()
769
769
data ['title' ] = u'Нет!!!!!!'
770
770
response = self .client .put (
@@ -818,7 +818,7 @@ def test_note_api_delete_bad_permissions(self):
818
818
"Deleting a note in an outside project is NOT OK"
819
819
note_obj = self .create_test_note ()
820
820
self .client .logout ()
821
- self .client .login (username = 'esther' , password = 'esther' )
821
+ self .client .login (username = 'esther@example.com ' , password = 'esther' )
822
822
response = self .client .delete (
823
823
reverse ('api:notes-detail' , args = [self .project .slug , note_obj .id ]),
824
824
content_type = 'application/json'
0 commit comments