@@ -1268,7 +1268,28 @@ def test_view_deleted(self):
1268
1268
response = self .client .get (self .url )
1269
1269
assert response .status_code == 404
1270
1270
1271
- def test_is_not_full_public_profile_because_not_developer (self ):
1271
+ def test_is_not_full_public_profile_because_not_developer_but_fields_present (self ):
1272
+ # TODO: when mimimal-profile-has-all-fields-shim is removed for v5, we should
1273
+ # change self.url to use v4 or v3
1274
+ assert not self .user .has_full_profile
1275
+ response = self .client .get (self .url ) # No auth.
1276
+ assert response .data ['name' ] == self .user .name
1277
+ assert response .data ['biography' ] is None
1278
+ assert 'email' not in response .data
1279
+ assert response .data ['url' ] == absolutify (self .user .get_url_path ())
1280
+
1281
+ # Login as a random user and check it's still not visible.
1282
+ self .client .login_api (user_factory ())
1283
+ response = self .client .get (self .url )
1284
+ assert response .data ['name' ] == self .user .name
1285
+ assert response .data ['biography' ] is None
1286
+ assert 'email' not in response .data
1287
+ assert response .data ['url' ] == absolutify (self .user .get_url_path ())
1288
+
1289
+ @override_settings (DRF_API_GATES = {'v5' : ()})
1290
+ def test_is_not_full_public_profile_because_not_developer_no_fields (self ):
1291
+ # TODO: when mimimal-profile-has-all-fields-shim is removed for v5, we won't
1292
+ # need the override_settings
1272
1293
assert not self .user .has_full_profile
1273
1294
response = self .client .get (self .url ) # No auth.
1274
1295
assert response .data ['name' ] == self .user .name
0 commit comments