kopia lustrzana https://github.com/Langenfeld/py-gitea
removed source_id from updating users as it seems to be not necessary
rodzic
5d1ed27c88
commit
f9b35d5aa4
|
@ -140,15 +140,15 @@ class User(GiteaApiObject):
|
|||
"must_change_password",
|
||||
"password",
|
||||
"prohibit_login",
|
||||
"source_id",
|
||||
"website",
|
||||
}
|
||||
|
||||
def commit(self):
|
||||
values = self.get_dirty_fields()
|
||||
values.update(
|
||||
{"source_id": self.source_id, "login_name": self.username}
|
||||
) # this request must always contain both, the user name and the _login source_ (e.g. ``None`` for local)
|
||||
# api-doc says that the "source_id" is necessary; works without though
|
||||
{"login_name": self.username}
|
||||
)
|
||||
args = {"username": self.username}
|
||||
self.gitea.requests_patch(User.ADMIN_EDIT_USER.format(**args), data=values)
|
||||
self.dirty_fields = {}
|
||||
|
|
|
@ -65,14 +65,15 @@ def test_create_user(instance):
|
|||
|
||||
def test_change_user(instance):
|
||||
user = instance.get_user_by_name(test_user)
|
||||
new_website = "http://testwebsite.de"
|
||||
user.website = new_website
|
||||
location = "a house"
|
||||
user.location = location
|
||||
new_fullname = "Other Test Full Name"
|
||||
user.full_name = new_fullname
|
||||
user.commit()
|
||||
del(user)
|
||||
user = instance.get_user_by_name(test_user)
|
||||
assert user.full_name == new_fullname
|
||||
assert user.location == location
|
||||
|
||||
|
||||
def test_create_org(instance):
|
||||
|
@ -207,8 +208,6 @@ def test_delete_org(instance):
|
|||
Organization.request(instance, test_org)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_delete_user(instance):
|
||||
user = User.request(instance, test_user)
|
||||
user.delete()
|
||||
|
|
Ładowanie…
Reference in New Issue